:root {
    --bg: #0f1419;
    --bg-2: #080c10;
    --plate: #1b2229;
    --plate-2: #131920;
    --plate-3: #232c35;
    --ink: #000000;
    --text: #ffffff;
    --text-light: #ffffff;
    --muted: #8e97af;
    --muted-light: #98a1b8;
    --gold: #ffd21e;
    --gold-2: #ff9d00;
    --gold-deep: #7a4600;
    --green: #1fbe5c;
    --green-2: #47e57d;
    --green-deep: #07331c;
    --red: #ff3b4e;
    --red-deep: #5c0912;
    --purple: #9b4dff;
    --blue: #2f8bff;
    --cyan: #22d3ee;
    --pink: #ff4fa3;
    --orange: #ff7a1a;
    --field: #0a0f14;
    --edge: 3px;
    --lift: 0 5px 0 var(--ink), 0 10px 22px rgba(0, 0, 0, .6);
    --lift-sm: 0 4px 0 var(--ink), 0 8px 16px rgba(0, 0, 0, .5);
    --gloss: inset 0 3px 0 rgba(255, 255, 255, .16), inset 0 -5px 0 rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #0f1419;
    background-image:
        radial-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        radial-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px);
    background-size: 14px 14px, 22px 22px;
    background-position: 0 0, 7px 11px;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

body.is-locked {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.wrap {
    width: min(1180px, 100% - 24px);
    margin-inline: auto;
}

.icon {
    display: block;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #0b1116;
    border-bottom: var(--edge) solid var(--ink);
    box-shadow: 0 5px 0 var(--ink);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 14px;
}

.hud {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 22px 9px 15px;
    border: var(--edge) solid var(--ink);
    border-radius: 18px;
    background: linear-gradient(180deg, #28323c 0%, #182028 55%, #0e141a 100%);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .16), 0 5px 0 var(--ink);
}

.hud__coin {
    display: grid;
    place-items: center;
    transform-origin: center;
    animation: coin-flip 5s ease-in-out infinite;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .45));
}

.hud__value {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -.4px;
    font-variant-numeric: tabular-nums;
    color: #ffdb4a;
    text-shadow: 0 2px 0 var(--gold-deep), 0 3px 0 rgba(0, 0, 0, .45);
    transition: color .25s ease, transform .25s ease, text-shadow .25s ease;
}

.hud.is-up .hud__value {
    color: #7bffb4;
    text-shadow: 0 2px 0 #08532f, 0 3px 0 rgba(0, 0, 0, .45);
    animation: value-pop .6s cubic-bezier(.2, .9, .25, 1.4);
}

.hud.is-up .hud__coin {
    animation: coin-spin .7s ease-in-out;
}

.hud.is-down .hud__value {
    color: #ff8b96;
    text-shadow: 0 2px 0 var(--red-deep), 0 3px 0 rgba(0, 0, 0, .45);
    animation: value-shake .5s ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 24px;
    border: var(--edge) solid var(--ink);
    border-radius: 15px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .3px;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn--primary {
    background: linear-gradient(180deg, #ffe14d 0%, var(--gold) 55%, var(--gold-2) 100%);
    color: #2a1900;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), var(--lift-sm);
}

.btn--primary:hover {
    filter: brightness(1.05);
}

.btn--ghost {
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--text);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), var(--lift-sm);
}

.btn--ghost:hover {
    filter: brightness(1.06);
}

.btn--primary:active,
.btn--ghost:active {
    transform: translateY(4px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 0 0 var(--ink);
}

.btn--block {
    width: 100%;
}

.btn.is-busy {
    opacity: .6;
    pointer-events: none;
}

.games {
    margin: 30px 0 40px;
}

.games__head {
    margin-bottom: 16px;
}

.games__title {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: .2px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 16px;
}

.card {
    position: relative;
    line-height: 0;
    border: var(--edge) solid var(--ink);
    border-radius: 18px;
    background: var(--plate);
    overflow: hidden;
    box-shadow: var(--lift);
    transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 9px 0 var(--ink), 0 14px 22px rgba(0, 0, 0, .45);
}

.card:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--ink);
}

.card__thumb {
    position: relative;
    aspect-ratio: 3 / 4;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.card__thumb::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .28), transparent);
    pointer-events: none;
}

.card__thumb--gold {
    background: linear-gradient(180deg, #ffe14d, #ff7a00);
}

.card__thumb--red {
    background: linear-gradient(180deg, #ff6b6b, #d81b30);
}

.card__thumb--green {
    background: linear-gradient(180deg, #5cf08d, #0f9159);
}

.card__thumb--purple {
    background: linear-gradient(180deg, #b782ff, #6a1fd6);
}

.card__thumb--blue {
    background: linear-gradient(180deg, #7fbaff, #1a55d6);
}

.card__thumb--cyan {
    background: linear-gradient(180deg, #6df0f7, #0a9aa8);
}

.card__thumb--pink {
    background: linear-gradient(180deg, #ff9ad0, #d61f86);
}

.card__img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card__initials {
    position: relative;
    z-index: 1;
    font-size: 46px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 0 rgba(0, 0, 0, .3);
}

.card__play {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: rgba(8, 10, 16, .5);
    opacity: 0;
    transition: opacity .15s ease;
}

.card__play::before {
    content: "";
    position: absolute;
    width: 50px;
    height: 50px;
    border: var(--edge) solid var(--ink);
    border-radius: 50%;
    background: linear-gradient(180deg, #5cf08d, var(--green));
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 4px 0 var(--ink);
}

.card__play::after {
    content: "";
    position: relative;
    width: 0;
    height: 0;
    margin-left: 6px;
    border-left: 16px solid #06331b;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.card:hover .card__play {
    opacity: 1;
}

.card__link {
    position: absolute;
    inset: 0;
    z-index: 3;
}



.hero {
    margin: 20px 0 14px;
}

.hero__link {
    display: block;
    border: var(--edge) solid var(--ink);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--lift);
    transition: transform .15s ease;
}

.hero__link:active {
    transform: translateY(3px);
}

.hero__img {
    width: 100%;
    height: auto;
    display: block;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 0 14px;
    border: var(--edge) solid var(--ink);
    border-radius: 16px;
    background: var(--field);
    box-shadow: inset 0 3px 0 rgba(0, 0, 0, .5), var(--lift-sm);
}

.search__icon {
    display: grid;
    place-items: center;
    color: var(--muted);
    flex: 0 0 auto;
}

.search__input {
    flex: 1;
    height: 52px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    caret-color: var(--gold);
}

.search__input:focus {
    outline: none;
}

.search__input::placeholder {
    color: var(--muted);
    font-weight: 700;
}

.search__clear {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: var(--plate-3);
    color: var(--muted);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 3px 0 var(--ink);
}

.search__clear:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--ink);
}

.rail.is-empty {
    display: none;
}

.card.is-hidden {
    display: none;
}

.rail--l6:not(.is-open) .card:nth-child(n+7),
.rail--l9:not(.is-open) .card:nth-child(n+10),
.rail--l12:not(.is-open) .card:nth-child(n+13),
.rail--l15:not(.is-open) .card:nth-child(n+16),
.rail--l18:not(.is-open) .card:nth-child(n+19) {
    display: none;
}

body.is-searching .rail:not(.is-open) .card {
    display: block;
}

body.is-searching .more {
    display: none;
}

.more {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 14px auto 0;
    height: 46px;
    border: var(--edge) solid var(--ink);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.more:hover {
    filter: brightness(1.1);
}

.more:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.kb {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg-2);
    border-top: var(--edge) solid var(--ink);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .5);
    animation: kb-in .18s ease;
}

.kb[hidden] {
    display: none;
}

@keyframes kb-in {
    from {
        transform: translateY(100%);
    }
    to {
        transform: none;
    }
}

.kb__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.kb__preview {
    flex: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border: var(--edge) solid var(--ink);
    border-radius: 13px;
    background: var(--field);
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    word-break: break-all;
    box-shadow: inset 0 3px 0 rgba(0, 0, 0, .5);
}

.kb__done {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 20px;
    border: var(--edge) solid var(--ink);
    border-radius: 13px;
    background: linear-gradient(180deg, var(--green-2), var(--green));
    color: #052a19;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 4px 0 var(--ink);
}

.kb__done:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.kb__rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-inline: auto;
}

.kb__rows--text {
    max-width: 820px;
}

.kb__rows--num {
    max-width: 340px;
}

.kb__row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.kb__key {
    flex: 1 1 0;
    min-width: 0;
    height: 52px;
    border: var(--edge) solid var(--ink);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    text-transform: none;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .08s ease, box-shadow .08s ease, filter .08s ease;
}

.kb__key:hover {
    filter: brightness(1.12);
}

.kb__key:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.kb__key--wide {
    flex: 1.6 1 0;
    font-size: 13px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.kb__key--space {
    flex: 4 1 0;
}

.kb__key--back {
    background: linear-gradient(180deg, #ff6b7c, var(--red));
    color: #43060e;
}

.kb__key--shift {
    background: linear-gradient(180deg, #ffe14d, var(--gold-2));
    color: #2a1900;
}

.kb__rows--num .kb__key {
    height: 62px;
    font-size: 24px;
}

body.has-kb .dock {
    display: none;
}

body.has-kb .modal__box {
    margin-bottom: 40vh;
}


.top {
    margin: 0 0 26px;
}

.top__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.top__trophy {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .45));
}

.top__title {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .2px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}

.top__accent {
    color: var(--green-2);
}

.top__nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.top__arrow {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: var(--edge) solid var(--ink);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--text);
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.top__arrow:hover {
    filter: brightness(1.15);
}

.top__arrow:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.top__track {
    display: flex;
    gap: 14px;
    padding: 4px 4px 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.top__track::-webkit-scrollbar {
    display: none;
}

.topitem {
    position: relative;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding-left: 66px;
}

.topitem__num {
    position: absolute;
    left: 0;
    top: 4px;
    z-index: 3;
    font-size: 210px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -12px;
    background-image: linear-gradient(176deg, #00fe7c 5%, rgba(0, 56, 26, .3) 94%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    pointer-events: none;
    user-select: none;
}

.topcard {
    position: relative;
    z-index: 1;
    display: block;
    width: 172px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .55);
    transition: transform .15s ease, box-shadow .15s ease;
}

.topcard:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .6);
}

.topcard:active {
    transform: translateY(2px);
}

.topcard__art {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 4;
    background: #0c1015;
    overflow: hidden;
}

.topcard__art .card__img {
    object-fit: cover;
}

.topcard__rank {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 7px 5px;
    border-radius: 8px;
    background: linear-gradient(180deg, #1fd66a, #0f9a48);
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.topcard__rank b {
    font-size: 15px;
    letter-spacing: 0;
}

.topcard__cta {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    border-radius: 7px;
    background: rgba(6, 10, 8, .82);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .8px;
    text-transform: uppercase;
}

@media (max-width: 720px) {
    .topcard {
        width: 138px;
    }

    .topitem {
        padding-left: 50px;
    }

    .topitem__num {
        font-size: 164px;
        letter-spacing: -9px;
    }

    .top__track {
        gap: 10px;
    }
}

.rail {
    margin-bottom: 30px;
}

.rail__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.rail__title {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: .2px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}

.rail__count {
    padding: 4px 10px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--plate-3);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 3px 0 var(--ink);
}

.empty {
    margin: 30px 0;
    text-align: center;
    font-weight: 800;
    color: var(--muted);
}

.body--game {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
}

.quick {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 90;
}

.quick__btn {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: var(--edge) solid var(--ink);
    border-radius: 15px;
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.quick__btn:hover {
    filter: brightness(1.06);
}

.quick__btn:active,
.quick.is-open .quick__btn {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.quick__menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    animation: quick-in .16s ease;
}

.quick__menu[hidden] {
    display: none;
}

@keyframes quick-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.quick__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    height: 46px;
    padding: 0 16px;
    border: var(--edge) solid var(--ink);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.quick__item:hover {
    filter: brightness(1.06);
}

.quick__item:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.quick__item--gold {
    background: linear-gradient(180deg, #ffe14d, var(--gold-2));
    color: #2a1900;
}

.quick__item--green {
    background: linear-gradient(180deg, var(--green-2), var(--green));
    color: #052a19;
}

.hidden-balance[hidden] {
    display: none;
}

.stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    background: #0b1015;
}

.stage--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px;
}

.stage__frame {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    display: block;
}

.dock {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: min(1180px, 100%);
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
}

.dock__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 52px;
    border: var(--edge) solid var(--ink);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--green-2) 0%, var(--green) 60%, #0f8f43 100%);
    color: #052a19;
    font-size: 15px;
    font-weight: 900;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), var(--lift-sm);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.dock__btn:hover {
    filter: brightness(1.06);
}

.dock__btn:active {
    transform: translateY(4px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 0 0 var(--ink);
}

.dock__btn--primary {
    background: linear-gradient(180deg, #ffe14d 0%, var(--gold) 55%, var(--gold-2) 100%);
    color: #2a1900;
}

.dock__icon {
    display: grid;
    place-items: center;
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25));
}

.dock__btn--primary .dock__icon {
    animation: dock-wallet 3.4s ease-in-out infinite;
}

.dock__btn:not(.dock__btn--primary) .dock__icon {
    animation: dock-cash 3.4s ease-in-out infinite;
}

.dock__btn:hover .dock__icon {
    animation-duration: 1.2s;
}

.footer {
    border-top: var(--edge) solid var(--ink);
    background: var(--bg-2);
    padding: 20px 0 calc(104px + env(safe-area-inset-bottom));
}

.footer__text,
.footer__copy {
    margin: 4px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal[hidden] {
    display: none;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 5, 9, .82);
    animation: fade-in .2s ease;
}

.modal__box {
    position: relative;
    width: min(430px, 100%);
    text-align: center;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 18px;
    border: var(--edge) solid var(--ink);
    border-radius: 22px;
    background: linear-gradient(180deg, var(--plate) 0%, var(--plate-2) 100%);
    box-shadow: var(--gloss), 0 8px 0 var(--ink), 0 18px 32px rgba(0, 0, 0, .5);
    animation: modal-in .22s cubic-bezier(.2, .9, .3, 1.15);
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    padding-top: 4px;
}

.modal__close {
    position: absolute;
    top: -6px;
    right: -4px;
    width: 36px;
    height: 36px;
    border: var(--edge) solid var(--ink);
    border-radius: 12px;
    background: linear-gradient(180deg, #ff6b7c, var(--red));
    color: #4b0710;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 4px 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.modal__close:hover {
    filter: brightness(1.06);
}

.modal__close:active {
    transform: translateY(4px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 0 0 var(--ink);
}

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

.tab {
    min-width: 118px;
    height: 44px;
    padding: 0 18px;
    border: var(--edge) solid var(--ink);
    border-radius: 13px;
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, color .2s ease;
}

.tab.is-active {
    background: linear-gradient(180deg, #ffe14d, var(--gold-2));
    color: #2a1900;
}

.tab:not(.is-active):active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.pane {
    display: none;
    animation: fade-in .2s ease;
}

.pane.is-active {
    display: block;
}

.step[hidden] {
    display: none;
}

.chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.chip-value {
    position: relative;
    height: 56px;
    padding: 0 6px;
    border: var(--edge) solid var(--ink);
    border-radius: 13px;
    background: linear-gradient(180deg, var(--plate-3), var(--plate-2));
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, border-color .12s ease;
}

.chip-value:hover {
    filter: brightness(1.12);
}

.chip-value:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--ink);
}

.chip-value--hot {
    box-shadow: 0 4px 0 var(--ink), inset 0 0 0 1px rgba(71, 229, 125, .45);
}

.chip-value__tag {
    position: absolute;
    top: -11px;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    transform: translateX(-50%);
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: linear-gradient(180deg, #5cf08d, var(--green));
    color: #05331b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.chip-value__tag .icon {
    width: 11px;
    height: 11px;
}

.chip-value__check {
    position: absolute;
    right: -6px;
    bottom: -6px;
    display: none;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--ink);
    border-radius: 7px;
    background: linear-gradient(180deg, #ffe14d, var(--gold-2));
    color: #2a1900;
    font-size: 12px;
    font-weight: 900;
}

.chip-value.is-active {
    border-color: var(--gold);
    background: linear-gradient(180deg, #2a2a1a, #1c1c12);
    color: var(--gold);
    box-shadow: 0 4px 0 var(--ink), inset 0 0 0 2px rgba(255, 210, 30, .5);
}

.chip-value.is-active .chip-value__check {
    display: grid;
}

.moneyrow {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    padding: 0 14px;
    margin-bottom: 12px;
    border: var(--edge) solid var(--ink);
    border-radius: 14px;
    background: var(--field);
    box-shadow: inset 0 3px 0 rgba(0, 0, 0, .5);
}

.moneyrow__prefix {
    flex: 0 0 auto;
    padding-right: 12px;
    border-right: 2px solid rgba(255, 255, 255, .12);
    color: var(--muted);
    font-size: 15px;
    font-weight: 900;
}

.moneyrow__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 20px;
    font-weight: 900;
    text-align: left;
    caret-color: var(--gold);
}

.moneyrow__input:focus {
    outline: none;
}

.moneyrow__input::placeholder {
    color: var(--muted);
}

.moneyrow__pix {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    border-left: 2px solid rgba(255, 255, 255, .12);
    color: #32bcad;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .5px;
}

.btn--green {
    background: linear-gradient(180deg, #5cf08d 0%, var(--green) 60%, #0f8f43 100%);
    color: #05331b;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), var(--lift-sm);
}

.btn--green:hover {
    filter: brightness(1.06);
}

.btn--green:active {
    transform: translateY(4px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 0 0 var(--ink);
}

.field {
    display: block;
    margin-bottom: 14px;
    text-align: center;
}

.field__label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: var(--muted);
    text-transform: uppercase;
    text-align: center;
}

.field__input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    text-align: center;
    border: var(--edge) solid var(--ink);
    border-radius: 13px;
    background: var(--field);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    box-shadow: inset 0 3px 0 rgba(0, 0, 0, .5);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field__input:focus {
    outline: none;
    box-shadow: inset 0 3px 0 rgba(0, 0, 0, .5), 0 0 0 3px rgba(255, 197, 49, .5);
}

.field__input--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.hint {
    margin: 0 0 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}

.alert {
    margin: 14px 0 0;
    padding: 11px 12px;
    text-align: center;
    border: var(--edge) solid var(--ink);
    border-radius: 12px;
    background: linear-gradient(180deg, #ff6b7c, var(--red));
    color: #43060e;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 0 var(--ink);
}

.alert[hidden] {
    display: none;
}

.status {
    margin: 12px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    color: var(--muted);
}

.status[hidden] {
    display: none;
}

.status.is-ok {
    color: var(--green-2);
}

.status.is-fail {
    color: #ff8b96;
}

.qr {
    display: grid;
    place-items: center;
    min-height: 190px;
    margin-bottom: 12px;
    padding: 12px;
    border: var(--edge) solid var(--ink);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 0 var(--ink);
}

.qr img {
    width: 190px;
    height: 190px;
}

.copybox {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.copybox .field__input {
    height: 46px;
    text-align: left;
}

.copybox .btn {
    height: 46px;
    flex: 0 0 auto;
    padding: 0 18px;
    font-size: 14px;
}

.coin {
    position: fixed;
    z-index: 60;
    color: var(--gold);
    pointer-events: none;
    animation: coin-rise 1s ease-out forwards;
}

@keyframes coin-rise {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(.6);
    }
    25% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -46px) scale(1.15);
    }
}

@keyframes coin-flip {
    0%, 72%, 100% {
        transform: scaleX(1) translateY(0);
    }
    78% {
        transform: scaleX(.12) translateY(-3px);
    }
    84% {
        transform: scaleX(1) translateY(-4px);
    }
    92% {
        transform: scaleX(1) translateY(0);
    }
}

@keyframes coin-spin {
    0% {
        transform: scaleX(1);
    }
    25% {
        transform: scaleX(.1) translateY(-5px);
    }
    50% {
        transform: scaleX(1) translateY(-7px);
    }
    75% {
        transform: scaleX(.1) translateY(-3px);
    }
    100% {
        transform: scaleX(1);
    }
}

@keyframes value-pop {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.13) translateY(-2px);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes value-shake {
    0%, 100% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(-5px);
    }
    60% {
        transform: translateX(5px);
    }
}

@keyframes dock-wallet {
    0%, 60%, 100% {
        transform: scale(1) rotate(0deg);
    }
    70% {
        transform: scale(1.16) rotate(-7deg);
    }
    80% {
        transform: scale(.96) rotate(5deg);
    }
    90% {
        transform: scale(1.04) rotate(-2deg);
    }
}

@keyframes dock-cash {
    0%, 58%, 100% {
        transform: translateY(0);
    }
    72% {
        transform: translateY(5px);
    }
    86% {
        transform: translateY(-1px);
    }
}

@media (min-width: 720px) {
    .dock {
        bottom: 16px;
        padding: 10px 12px;
    }

    .dock__btn {
        height: 58px;
        font-size: 17px;
    }
}

@media (max-width: 720px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .chips {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .chip-value {
        height: 52px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

@media (min-width: 1500px) {
    .wrap {
        width: min(1420px, 100% - 40px);
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 18px;
    }

    .topcard {
        width: 196px;
    }

    .topitem {
        padding-left: 84px;
    }

    .topitem__num {
        font-size: 244px;
    }

    .rail__title {
        font-size: 21px;
    }

    .hud__value {
        font-size: 29px;
    }

    .dock {
        width: min(1420px, 100%);
    }
}

@media (max-width: 900px) {
    .top__title {
        font-size: 19px;
    }

    .search__input {
        height: 48px;
        font-size: 15px;
    }
}

@media (max-width: 620px) {
    .wrap {
        width: min(1180px, 100% - 16px);
    }

    .hud {
        padding: 7px 16px 7px 12px;
        gap: 9px;
    }

    .hud__value {
        font-size: 22px;
    }

    .hud__coin svg {
        width: 30px;
        height: 30px;
    }

    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
    }

    .rail__head {
        gap: 8px;
    }

    .rail__title {
        font-size: 16px;
    }

    .rail__count {
        font-size: 10px;
        padding: 3px 8px;
    }

    .top__head {
        gap: 8px;
    }

    .top__trophy {
        width: 30px;
        height: 30px;
    }

    .top__arrow {
        width: 36px;
        height: 36px;
    }

    .search {
        padding: 0 10px;
        gap: 8px;
    }

    .modal {
        padding: 10px;
    }

    .modal__box {
        padding: 15px;
        border-radius: 18px;
    }

    .tab {
        min-width: 0;
        flex: 1;
        height: 42px;
        padding: 0 10px;
        font-size: 13px;
    }

    .moneyrow {
        height: 52px;
        gap: 8px;
        padding: 0 10px;
    }

    .moneyrow__input {
        font-size: 17px;
    }

    .moneyrow__pix {
        font-size: 11px;
        padding-left: 8px;
    }

    .field__input {
        height: 48px;
        font-size: 14px;
    }

    .btn {
        height: 48px;
        font-size: 15px;
    }

    .dock__btn {
        height: 48px;
        font-size: 14px;
    }

    .kb__key {
        height: 46px;
        font-size: 16px;
    }

    .kb__rows--num .kb__key {
        height: 54px;
        font-size: 21px;
    }

    .kb__key--wide {
        font-size: 11px;
    }

    .kb__preview {
        font-size: 15px;
        min-height: 40px;
    }

    .quick__btn {
        width: 44px;
        height: 44px;
    }

    .quick__item {
        min-width: 118px;
        height: 42px;
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topcard {
        width: 124px;
    }

    .topitem {
        padding-left: 42px;
    }

    .topitem__num {
        font-size: 142px;
        letter-spacing: -8px;
    }

    .chips {
        gap: 7px;
    }

    .chip-value {
        height: 48px;
        font-size: 12px;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .kb__key {
        height: 38px;
    }

    .kb__rows--num .kb__key {
        height: 42px;
    }

    .modal__box {
        max-height: calc(100vh - 20px);
    }
}

.kiosk {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #0f1419;
}

.kiosk[hidden] {
    display: none;
}

body.is-kiosk {
    overflow: hidden;
}

.kiosk__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(340px, 100%);
    padding: 28px 24px 24px;
    border: var(--edge) solid var(--ink);
    border-radius: 22px;
    background: linear-gradient(180deg, var(--plate), var(--plate-2));
    box-shadow: var(--gloss), var(--lift);
    text-align: center;
}

.kiosk__coin {
    display: grid;
    place-items: center;
    animation: coin-flip 4s ease-in-out infinite;
}

.kiosk__title {
    margin: 4px 0 0;
    font-size: 22px;
    font-weight: 900;
}

.kiosk__text {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.done {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 10, 14, .9);
    animation: fade-in .18s ease;
}

.done[hidden] {
    display: none;
}

body.is-done {
    overflow: hidden;
}

.done__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: min(360px, 100%);
    padding: 30px 24px 26px;
    border: var(--edge) solid var(--ink);
    border-radius: 22px;
    background: linear-gradient(180deg, var(--plate), var(--plate-2));
    box-shadow: var(--gloss), var(--lift);
    text-align: center;
    animation: done-pop .4s cubic-bezier(.2, .9, .25, 1.35);
}

.done__mark {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 6px;
    border: var(--edge) solid var(--ink);
    border-radius: 50%;
    background: linear-gradient(180deg, var(--green-2), var(--green));
    color: #05331b;
    font-size: 38px;
    font-weight: 900;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 5px 0 var(--ink);
    animation: done-mark .5s cubic-bezier(.2, .9, .25, 1.5);
}

.done__title {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
}

.done__value {
    margin: 0;
    font-size: 32px;
    font-weight: 900;
    color: var(--green-2);
    text-shadow: 0 2px 0 var(--green-deep);
}

.done__text {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

@keyframes done-pop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.94);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes done-mark {
    0% {
        transform: scale(.3) rotate(-25deg);
    }
    60% {
        transform: scale(1.18) rotate(6deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}
