/* Base interface styles, moved out of HTML for browser caching. */
:root {
            --bg: #050407;
            --panel: rgba(14, 10, 20, .9);
            --text: #f7f2ff;
            --muted: #aaa1b8;
            --line: rgba(171, 96, 255, .26);
            --line-strong: rgba(193, 126, 255, .5);
            --accent: #a84dff;
            --soft: #d9b5ff;
            --card-bg: rgba(29, 18, 40, .94);
            --border-glow: rgba(210, 151, 255, .62);
            --shadow-glow: rgba(132, 47, 214, .17);
        }

        * {
            box-sizing: border-box
        }

        html {
            background: var(--bg);
            scroll-behavior: smooth;
            scrollbar-color: #9140d2 #08060b;
            scrollbar-width: thin
        }

        body {
            margin: 0;
            min-height: 100vh;
            color: var(--text);
            font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
            background: radial-gradient(circle at 50% -5%, rgba(125, 47, 188, .34), transparent 42%), #050407
        }

        body::before {
            content: "";
            position: fixed;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            background-image: linear-gradient(rgba(5, 4, 7, .2), rgba(5, 4, 7, .72)), url("./assets/wallpaper-desktop.webp");
            background-position: center top;
            background-size: cover;
            background-repeat: no-repeat
        }

        header,
        main {
            max-width: 1260px;
            margin: auto;
            padding-left: 20px;
            padding-right: 20px;
            padding-bottom: 90px;
            position: relative;
            z-index: 1
        }

        header {
            min-height: 280px;
            padding-top: 42px;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding-bottom: 20px
        }

        .eyebrow {
            display: flex;
            align-items: baseline;
            gap: 12px;
            width: max-content;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            backdrop-filter: none;
            color: #eee6f8;
            font-size: clamp(16px, 2.1vw, 25px);
            font-weight: 950;
            letter-spacing: .11em;
            text-transform: uppercase;
            text-shadow: 0 4px 18px rgba(0, 0, 0, .72);
            box-shadow: none
        }
        .eyebrow a {
            color: #fff;
            text-decoration: none;
            transition: color .2s ease, text-shadow .2s ease
        }
        .eyebrow a:hover {
            color: #d6a7ff;
            text-shadow: 0 0 20px rgba(168, 77, 255, .55)
        }
        .dot {
            color: #8d829a;
            font-size: .72em
        }
        .section-name {
            color: #c8a0ef
        }

        h1 {
            font-size: clamp(36px, 5vw, 64px);
            line-height: .94;
            letter-spacing: -.05em;
            margin: 13px 0 10px;
            background: linear-gradient(180deg, #fff 15%, #d9c1f5 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            text-shadow: 0 8px 32px rgba(0, 0, 0, .5);
            filter: drop-shadow(0 0 22px rgba(138, 55, 216, .14))
        }

        .subtitle {
            margin: 0;
            color: #d2c9db;
            font-size: initial;
            text-shadow: none
        }

        .actions {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 16px;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 1px solid rgba(183, 105, 255, .1)
        }

        .actions .nav-btn {
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            min-width: 104px;
            justify-content: center;
            font-weight: 700;
            color: #fff;
            border: 1px solid rgba(206, 146, 255, .48);
            border-radius: 14px;
            padding: 9px 16px;
            cursor: pointer;
            background: linear-gradient(180deg, rgba(86, 42, 119, .72), rgba(34, 19, 47, .9));
            transition: all .2s ease
        }
        .actions .nav-btn:hover {
            border-color: rgba(215, 155, 255, .75);
            transform: translateY(-2px);
            box-shadow: 0 10px 28px rgba(91, 35, 142, .22)
        }

        button {
            font: inherit;
            color: inherit;
            background: linear-gradient(180deg, rgba(45, 25, 63, .9), rgba(16, 10, 23, .95));
            border: 1px solid rgba(183, 105, 255, .3);
            border-radius: 14px;
            padding: 9px 16px;
            cursor: pointer;
            transition: all .2s ease;
            box-shadow: 0 0 0 1px rgba(255, 255, 255, .02) inset;
            backdrop-filter: blur(4px)
        }
        button:hover {
            border-color: rgba(210, 151, 255, .62);
            background: rgba(33, 24, 42, .9);
            box-shadow: 0 0 34px rgba(132, 47, 214, .17);
            transform: translateY(-2px)
        }
        button:active {
            transform: translateY(0)
        }

        .grid-wrapper {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 340px;
            gap: 24px;
            align-items: start;
            position: relative
        }

        .panel {
            background: linear-gradient(155deg, rgba(29, 18, 40, .94), rgba(10, 7, 15, .98));
            backdrop-filter: blur(12px);
            border: 1px solid rgba(183, 105, 255, .3);
            border-radius: 20px;
            padding: 24px;
            box-shadow: 0 16px 38px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .025);
            transition: border-color .22s ease, box-shadow .22s ease
        }
        .panel:hover {
            border-color: rgba(210, 151, 255, .62);
            box-shadow: 0 24px 52px rgba(0, 0, 0, .52), 0 0 34px rgba(132, 47, 214, .17)
        }

        .panel h2,
        .panel h3 {
            color: #eee6f8;
            font-weight: 700;
            letter-spacing: -.02em
        }

        .panel h2 {
            font-size: 28px;
            margin-top: 0;
            margin-bottom: 20px
        }

        .panel h3 {
            font-size: 18px;
            margin-top: 28px;
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(183, 105, 255, .15)
        }

        .group {
            margin: 18px 0
        }

        .rail {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            background: transparent;
            border: none;
            padding: 0;
            color: #d2c9db
        }
        .rail b {
            color: #eee6f8
        }
        .rail strong {
            color: #d2a8ff;
            background: rgba(210, 168, 255, .1);
            padding: 2px 12px;
            border-radius: 20px;
            font-size: 14px
        }

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

        .slot-card {
            background: rgba(14, 10, 20, .4);
            backdrop-filter: blur(4px);
            border: 2px dashed rgba(183, 105, 255, .2);
            border-radius: 14px;
            padding: 10px 14px;
            min-height: 60px;
            display: flex;
            align-items: center;
            cursor: pointer;
            transition: all .22s ease;
            position: relative;
            overflow: hidden
        }
        .slot-card:hover {
            border-color: rgba(210, 151, 255, .62);
            background: rgba(33, 24, 42, .5);
            transform: translateY(-5px);
            box-shadow: 0 24px 52px rgba(0, 0, 0, .52), 0 0 34px rgba(132, 47, 214, .17)
        }
        .slot-card.filled {
            border-style: solid;
            border-color: rgba(183, 105, 255, .3);
            background: rgba(14, 10, 20, .6)
        }
        .slot-card.disabled {
            opacity: .5;
            cursor: not-allowed
        }
        .slot-card.disabled:hover {
            transform: none;
            box-shadow: none;
            border-color: rgba(183, 105, 255, .2)
        }

        .slot-card .item {
            width: 100%;
            background: transparent;
            border: none;
            padding: 0;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0
        }
        .slot-card .item:hover {
            background: transparent;
            border: none;
            transform: none;
            box-shadow: none
        }

        .slot-card .item .x {
            display: none !important
        }

        .slot-card .item .art {
            flex-shrink: 0;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: rgba(14, 10, 20, .8);
            border: 1px solid rgba(183, 105, 255, .2);
            display: grid;
            place-items: center;
            overflow: hidden
        }
        .slot-card .item .art img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 2px
        }

        .slot-card .item .iname {
            display: flex;
            flex-direction: column;
            min-width: 0;
            overflow: hidden
        }
        .slot-card .item .iname b {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 14px;
            font-weight: 700
        }
        .slot-card .item .iname small {
            color: #9e91a8;
            font-size: 11px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        .slot-card .empty-content {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #82788f;
            width: 100%
        }
        .slot-card .empty-content .plus {
            font-size: 24px;
            color: #b478dd;
            opacity: .5;
            flex-shrink: 0
        }
        .slot-card .empty-content small {
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        /* Мувменты */
        .moves-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px
        }

        .move-slot {
            min-height: 70px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(14, 10, 20, .4);
            backdrop-filter: blur(4px);
            border: 2px dashed rgba(183, 105, 255, .2);
            border-radius: 14px;
            transition: all .22s ease;
            padding: 8px;
            cursor: pointer;
            position: relative;
            overflow: hidden
        }
        .move-slot:hover {
            border-color: rgba(210, 151, 255, .62);
            background: rgba(33, 24, 42, .5);
            transform: translateY(-5px);
            box-shadow: 0 24px 52px rgba(0, 0, 0, .52), 0 0 34px rgba(132, 47, 214, .17)
        }
        .move-slot.filled {
            border-style: solid;
            border-color: rgba(183, 105, 255, .3);
            background: rgba(14, 10, 20, .6)
        }

        .move-slot .item {
            width: 100%;
            background: transparent;
            border: none;
            padding: 4px 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0
        }
        .move-slot .item:hover {
            background: transparent;
            border: none;
            transform: none;
            box-shadow: none
        }

        .move-slot .item .x {
            display: none !important
        }

        .move-slot .item .art {
            flex-shrink: 0;
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: rgba(14, 10, 20, .8);
            border: 1px solid rgba(183, 105, 255, .2);
            display: grid;
            place-items: center;
            overflow: hidden
        }
        .move-slot .item .art img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 2px
        }

        .move-slot .item .iname {
            display: flex;
            flex-direction: column;
            min-width: 0;
            overflow: hidden;
            flex: 1
        }
        .move-slot .item .iname b {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 13px;
            font-weight: 700
        }
        .move-slot .item .iname small {
            color: #9e91a8;
            font-size: 10px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        .move-slot .item .cooldown {
            font-size: 11px;
            color: #9e91a8;
            margin-left: auto;
            padding-left: 8px;
            white-space: nowrap;
            flex-shrink: 0
        }

        .move-slot .empty-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            color: #82788f
        }
        .move-slot .empty-content .plus {
            font-size: 28px;
            color: #b478dd;
            opacity: .5
        }
        .move-slot .empty-content small {
            font-size: 11px
        }

        /* Панель расчета */
        .summary {
            position: sticky;
            top: 20px;
            align-self: start
        }

        .metric {
            padding: 12px 10px;
            margin: 0 -10px;
            border-bottom: 1px solid rgba(42, 32, 48, .4);
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 2px;
            align-items: center;
            transition: all .3s ease;
            border-radius: 8px
        }
        .metric:last-of-type {
            border-bottom: none
        }
        .metric small {
            grid-column: 1 / -1;
            color: #9e91a8;
            font-size: 13px
        }
        .metric b {
            font-size: 28px;
            font-weight: 800;
            letter-spacing: -.02em;
            transition: all .3s ease
        }
        .metric b.changed {
            color: #c8a0ef;
            transform: scale(1.1)
        }
        .metric span {
            color: #c8a0ef;
            font-weight: 600;
            align-self: end;
            padding-bottom: 2px
        }
        .metric.clickable {
            cursor: pointer
        }
        .metric.clickable:hover {
            background: rgba(168, 77, 255, .08);
            border-color: rgba(210, 151, 255, .3)
        }
        .metric.disabled {
            opacity: .5;
            cursor: not-allowed
        }
        .metric.disabled:hover {
            background: transparent
        }

        /* Модальное окно для деталей метрики */
        .metric-detail-modal {
            position: fixed;
            inset: 0;
            z-index: 200;
            display: grid;
            place-items: center;
            padding: 18px;
            background: rgba(3, 2, 6, .86);
            backdrop-filter: blur(12px);
            animation: modalFadeIn .2s ease
        }
        .metric-detail-modal[hidden] {
            display: none
        }
        .metric-detail-modal .modal-card {
            width: min(520px, 100%);
            max-height: 80vh;
            overflow: auto;
            border: 1px solid rgba(203, 137, 255, .48);
            border-radius: 20px;
            background: linear-gradient(155deg, rgba(29, 18, 40, .995), rgba(10, 7, 15, .995));
            box-shadow: 0 28px 90px rgba(0, 0, 0, .72), 0 0 50px rgba(118, 44, 184, .2);
            padding: 24px
        }
        .metric-detail-modal .modal-card .close-btn {
            float: right;
            width: 40px;
            height: 40px;
            border: 1px solid rgba(206, 146, 255, .38);
            border-radius: 11px;
            background: #1b1025;
            color: #fff;
            font-size: 25px;
            cursor: pointer;
            display: grid;
            place-items: center;
            padding: 0;
            line-height: 1
        }
        .metric-detail-modal .modal-card .close-btn:hover {
            border-color: rgba(215, 155, 255, .75);
            transform: translateY(-1px);
            box-shadow: 0 10px 28px rgba(91, 35, 142, .22)
        }
        .metric-detail-modal .modal-card h3 {
            margin-top: 0;
            margin-bottom: 16px;
            font-size: 22px;
            color: #f0e5f7
        }
        .metric-detail-card {
            overflow: hidden !important;
            padding: 0 !important;
        }
        .metric-detail-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            padding: 18px 18px 16px;
            border-bottom: 1px solid rgba(255,255,255,.08);
            background: linear-gradient(135deg, rgba(47,25,62,.95), rgba(16,10,22,.98));
        }
        .metric-detail-head h3 {
            margin: 3px 0 0 !important;
        }
        .metric-detail-kicker {
            display: block;
            color: #a985c7;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: .14em;
        }
        .metric-detail-head .close-btn {
            float: none !important;
            flex: 0 0 auto;
        }
        .metric-detail-card #metricDetailContent {
            overflow: auto;
            padding: 8px 18px 18px;
            max-height: calc(80vh - 92px);
        }
        .metric-detail-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 0;
            border-bottom: 1px solid rgba(42, 32, 48, .3)
        }
        .metric-detail-item:last-child {
            border-bottom: none
        }
        .metric-detail-item .icon {
            flex-shrink: 0;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            background: rgba(14, 10, 20, .8);
            border: 1px solid rgba(183, 105, 255, .2);
            display: grid;
            place-items: center;
            overflow: hidden
        }
        .metric-detail-item .icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 2px
        }
        .metric-detail-item .info {
            flex: 1;
            min-width: 0
        }
        .metric-detail-item .info .name {
            display: block;
            color: #d2c9db;
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }
        .metric-detail-item .info .value {
            display: block;
            color: #c8a0ef;
            font-weight: 600;
            font-size: 13px
        }
        .metric-detail-empty {
            color: #82788f;
            text-align: center;
            padding: 30px 0
        }
        .metric-detail-modal .modal-card .min-size {
            min-height: 120px;
            display: flex;
            align-items: center;
            justify-content: center
        }

        /* Модальное окно выбора */
        .modal {
            position: fixed;
            inset: 0;
            z-index: 100;
            display: grid;
            place-items: center;
            padding: 18px;
            background: rgba(3, 2, 6, .86);
            backdrop-filter: blur(12px);
            animation: modalFadeIn .2s ease
        }
        .modal[hidden] {
            display: none
        }

        @keyframes modalFadeIn {
            from {
                opacity: 0;
                transform: scale(.95) translateY(10px)
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0)
            }
        }

        .modal-card {
            width: min(680px, 100%);
            max-height: 85vh;
            overflow: hidden;
            border: 1px solid rgba(203, 137, 255, .48);
            border-radius: 20px;
            background: linear-gradient(155deg, rgba(29, 18, 40, .995), rgba(10, 7, 15, .995));
            box-shadow: 0 28px 90px rgba(0, 0, 0, .72), 0 0 50px rgba(118, 44, 184, .2);
            display: flex;
            flex-direction: column
        }

        .modal-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, .09);
            background: linear-gradient(90deg, #21132e, #100a16)
        }
        .modal-head b {
            font-size: 18px;
            color: #f0e5f7
        }

        .modal-head .close-btn {
            width: 40px;
            height: 40px;
            border: 1px solid rgba(206, 146, 255, .38);
            border-radius: 11px;
            background: #1b1025;
            color: #fff;
            font-size: 25px;
            cursor: pointer;
            display: grid;
            place-items: center;
            padding: 0;
            line-height: 1
        }
        .modal-head .close-btn:hover {
            border-color: rgba(215, 155, 255, .75);
            transform: translateY(-1px);
            box-shadow: 0 10px 28px rgba(91, 35, 142, .22)
        }

        .modal-card input {
            margin: 16px 20px;
            padding: 14px 16px;
            background: rgba(10, 8, 13, .8);
            border: 1px solid rgba(183, 105, 255, .25);
            border-radius: 14px;
            color: #fff;
            font: inherit;
            outline: none;
            transition: border-color .2s ease
        }
        .modal-card input:focus {
            border-color: rgba(201, 139, 255, .6);
            box-shadow: 0 0 0 3px rgba(154, 75, 232, .1)
        }

        #results {
            overflow-y: auto;
            flex: 1;
            padding: 0 12px 12px
        }

        .result {
            width: 100%;
            text-align: left;
            background: transparent;
            border: none;
            border-bottom: 1px solid rgba(42, 32, 48, .3);
            border-radius: 0;
            padding: 8px 4px;
            transition: background .15s ease;
            cursor: pointer
        }
        .result:hover {
            background: rgba(33, 24, 42, .6);
            border-color: rgba(183, 105, 255, .2);
            transform: none;
            box-shadow: none
        }

        .result .item {
            background: transparent;
            border: none;
            padding: 4px 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px
        }
        .result .item:hover {
            background: transparent;
            border: none;
            transform: none;
            box-shadow: none
        }

        .result .art {
            flex-shrink: 0;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: rgba(14, 10, 20, .8);
            border: 1px solid rgba(183, 105, 255, .2);
            display: grid;
            place-items: center;
            overflow: hidden
        }
        .result .art img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 2px
        }

        .result .iname {
            display: flex;
            flex-direction: column;
            min-width: 0;
            overflow: hidden
        }
        .result .iname b {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 14px
        }
        .result .iname small {
            color: #9e91a8;
            font-size: 11px
        }

        .modal-card .muted {
            color: #82788f;
            text-align: center;
            padding: 30px 0
        }

        .clear-slot-btn {
            margin: 0 20px 16px;
            padding: 10px;
            background: rgba(255, 50, 50, .1);
            border: 1px solid rgba(255, 50, 50, .3);
            border-radius: 12px;
            color: #ff7b7b;
            font-weight: 600;
            text-align: center;
            display: none;
            cursor: pointer;
            transition: all .2s ease
        }
        .clear-slot-btn.visible {
            display: block
        }
        .clear-slot-btn:hover {
            background: rgba(255, 50, 50, .2);
            border-color: rgba(255, 50, 50, .5);
            transform: translateY(-1px)
        }

        /* Кнопка "Наверх" */
        .to-top {
            position: fixed;
            right: 18px;
            bottom: calc(18px + env(safe-area-inset-bottom));
            z-index: 30;
            width: 44px;
            height: 44px;
            border: 1px solid rgba(205, 143, 255, .48);
            border-radius: 14px;
            background: linear-gradient(180deg, rgba(45, 25, 63, .96), rgba(16, 10, 23, .97));
            color: #efdfff;
            font-size: 19px;
            box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 24px rgba(131, 46, 213, .17);
            opacity: 0;
            visibility: hidden;
            transform: translateY(8px);
            transition: .2s;
            display: grid;
            place-items: center
        }
        .to-top.visible {
            opacity: 1;
            visibility: visible;
            transform: none
        }

        .scroll-progress {
            position: fixed;
            left: 0;
            top: 0;
            z-index: 9999;
            width: 0;
            height: 3px;
            background: linear-gradient(90deg, #7430c8, #c66eff, #eed6ff);
            box-shadow: 0 0 13px #b75cff;
            pointer-events: none
        }

        ::-webkit-scrollbar {
            width: 11px;
            height: 11px
        }
        ::-webkit-scrollbar-track {
            background: #08060b
        }
        ::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #542077, #a64ee5);
            border: 2px solid #08060b;
            border-radius: 999px
        }
        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #7330a4, #c063ff)
        }

        .miniapp header {
            min-height: 240px
        }

        .toast-notification {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(18, 12, 23, .95);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(183, 105, 255, .3);
            border-radius: 14px;
            padding: 14px 24px;
            color: #f7f2ff;
            font: inherit;
            z-index: 9999;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
            animation: modalFadeIn .2s ease;
            max-width: 90%;
            text-align: center
        }

        .confirm-overlay {
            position: fixed;
            inset: 0;
            z-index: 10000;
            display: grid;
            place-items: center;
            background: rgba(3, 2, 6, .86);
            backdrop-filter: blur(12px);
            animation: modalFadeIn .2s ease
        }
        .confirm-overlay .box {
            width: min(400px, 90%);
            padding: 24px;
            border: 1px solid rgba(203, 137, 255, .48);
            border-radius: 20px;
            background: linear-gradient(155deg, rgba(29, 18, 40, .995), rgba(10, 7, 15, .995));
            box-shadow: 0 28px 90px rgba(0, 0, 0, .72), 0 0 50px rgba(118, 44, 184, .2);
            text-align: center
        }
        .confirm-overlay .box h3 {
            margin: 0 0 16px;
            color: #f0e5f7;
            font-size: 20px
        }
        .confirm-overlay .box .buttons {
            display: flex;
            gap: 12px;
            justify-content: center
        }
        .confirm-overlay .box .buttons .yes {
            padding: 10px 30px;
            background: rgba(168, 77, 255, .2);
            border: 1px solid rgba(168, 77, 255, .4);
            border-radius: 12px;
            color: #fff;
            cursor: pointer;
            font: inherit;
            transition: all .2s ease
        }
        .confirm-overlay .box .buttons .yes:hover {
            background: rgba(168, 77, 255, .3);
            border-color: rgba(168, 77, 255, .6)
        }
        .confirm-overlay .box .buttons .no {
            padding: 10px 30px;
            background: rgba(255, 50, 50, .1);
            border: 1px solid rgba(255, 50, 50, .3);
            border-radius: 12px;
            color: #ff7b7b;
            cursor: pointer;
            font: inherit;
            transition: all .2s ease
        }
        .confirm-overlay .box .buttons .no:hover {
            background: rgba(255, 50, 50, .2);
            border-color: rgba(255, 50, 50, .5)
        }

        @media (max-width:850px) {
            .grid-wrapper {
                grid-template-columns: 1fr
            }
            .summary {
                position: static;
                order: -1
            }
            .moves-grid {
                grid-template-columns: repeat(3, 1fr)
            }
            .slots-grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr))
            }
        }

        @media (max-width:620px) {
            body::before {
                background-image: linear-gradient(rgba(5, 4, 7, .25), rgba(5, 4, 7, .75)), url("./assets/wallpaper-mobile.webp")
            }
            header {
                min-height: 180px;
                padding-top: calc(20px + env(safe-area-inset-top))
            }
            .moves-grid {
                grid-template-columns: repeat(2, 1fr)
            }
            .slots-grid {
                grid-template-columns: 1fr 1fr
            }
            h1 {
                font-size: 28px
            }
            .panel {
                padding: 16px
            }
            main {
                padding-bottom: 110px
            }
            .modal-card {
                margin: 10px
            }
            .move-slot {
                min-height: 60px
            }
            button:hover {
                transform: none
            }
            .slot-card:hover {
                transform: none
            }
            .move-slot:hover {
                transform: none
            }
            .panel:hover {
                border-color: rgba(183, 105, 255, .3);
                box-shadow: 0 16px 38px rgba(0, 0, 0, .42)
            }
            .actions {
                margin-bottom: 16px;
                padding-bottom: 12px
            }
        }

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

/* Visual refinement layer. The original purple/black Shindo aesthetic is retained. */
:root {
    --surface-1: rgba(21, 13, 29, .94);
    --surface-2: rgba(10, 7, 15, .97);
    --surface-3: rgba(39, 23, 53, .72);
    --accent-soft: #d9b5ff;
    --accent-bright: #bd72ff;
    --success-soft: #bfe8cf;
    --app-viewport-height: 100vh;
    --tg-safe-top: 0px;
    --tg-safe-right: 0px;
    --tg-safe-bottom: 0px;
    --tg-safe-left: 0px;
}

body {
    min-height: var(--app-viewport-height);
    isolation: isolate;
    background: #050407;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Replace these two files in assets to change the wallpaper. */
body::before {
    background-image:
        linear-gradient(180deg, rgba(5, 4, 7, .18), rgba(5, 4, 7, .80) 58%, #050407 100%),
        radial-gradient(circle at 18% 4%, rgba(177, 84, 255, .16), transparent 30%),
        url("./assets/wallpaper-desktop.webp");
    background-color: #050407;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .42) 100%);
}

header,
main {
    z-index: 1;
}

header {
    min-height: 250px;
}

.actions button {
    min-width: 104px;
    font-weight: 700;
}

.actions button:first-child {
    border-color: rgba(206, 146, 255, .48);
    background: linear-gradient(180deg, rgba(86, 42, 119, .72), rgba(34, 19, 47, .9));
}

.actions button:focus-visible,
.slot-card:focus-visible,
.move-slot:focus-visible,
.metric:focus-visible,
.result:focus-visible,
.close-btn:focus-visible,
.to-top:focus-visible {
    outline: 2px solid var(--accent-soft);
    outline-offset: 3px;
}

.panel {
    overflow: hidden;
}

.build-panel {
    min-width: 0;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-title-row h2 {
    margin: 0;
}

.selection-count {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 10px;
    border: 1px solid rgba(194, 124, 255, .25);
    border-radius: 999px;
    background: rgba(168, 77, 255, .08);
    color: #d7b4f5;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.selection-count {
    border-color: rgba(156, 229, 187, .18);
    background: rgba(96, 184, 134, .07);
    color: var(--success-soft);
}

.rail {
    padding-bottom: 2px;
}

.slot-card,
.move-slot {
    outline: none;
}

.slot-card::before,
.move-slot::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(115deg, transparent 15%, rgba(213, 158, 255, .07), transparent 75%);
    transition: opacity .22s ease;
}

.slot-card:hover::before,
.move-slot:hover::before,
.slot-card:focus-visible::before,
.move-slot:focus-visible::before {
    opacity: 1;
}

.slot-card.disabled {
    border-style: solid;
    background: rgba(14, 10, 20, .26);
}

.slot-card.disabled .plus {
    display: none;
}

.slot-card.disabled .empty-content::before {
    content: "•";
    width: 24px;
    height: 24px;
    border: 1px solid rgba(183, 105, 255, .18);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: rgba(217, 181, 255, .4);
}

.slot-card.has-gamepass {
    min-height: 78px;
    padding-top: 27px;
}

.slot-gamepass {
    position: absolute;
    top: 7px;
    right: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    padding: 2px 6px;
    border: 1px solid rgba(241, 199, 101, .42);
    border-radius: 999px;
    background: rgba(72, 50, 12, .72);
    color: #f2d48b;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1;
    pointer-events: none;
}


.art img {
    display: block;
}

.art-empty {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background:
        radial-gradient(circle at 35% 30%, rgba(208, 153, 255, .12), transparent 34%),
        linear-gradient(145deg, rgba(44, 27, 58, .78), rgba(12, 8, 17, .92));
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 5px;
}


.item-title-row {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
    flex-wrap: wrap;
}

.item-title-row > b {
    min-width: 0;
}

.item-tags {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
}

.item-tag {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 6px;
    border: 1px solid rgba(205, 145, 255, .28);
    border-radius: 999px;
    background: rgba(168, 77, 255, .09);
    color: #d6b8ef;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .07em;
    line-height: 1;
    white-space: nowrap;
}

.item-tag.rework {
    border-color: rgba(255, 111, 226, .42);
    background: rgba(238, 73, 203, .13);
    color: #ffc5f3;
    box-shadow: inset 0 0 0 1px rgba(255, 197, 243, .04);
}

.item-meta em {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border: 1px solid rgba(199, 134, 255, .17);
    border-radius: 999px;
    background: rgba(168, 77, 255, .06);
    color: #bdafca;
    font-size: 10px;
    font-style: normal;
    line-height: 1.35;
}

.result .item {
    align-items: flex-start;
}

.result .iname {
    flex: 1;
}

.result .iname b,
.result .iname small {
    white-space: normal;
}

.result .art {
    width: 44px;
    height: 44px;
}

.results-limit {
    margin: 10px 8px 4px;
    padding: 10px 12px;
    border: 1px solid rgba(183, 105, 255, .16);
    border-radius: 12px;
    background: rgba(168, 77, 255, .055);
    color: #9f91ae;
    font-size: 12px;
    text-align: center;
}

.results-section-label {
    margin: 10px 8px 7px;
    padding: 7px 9px;
    border-left: 2px solid rgba(190, 111, 255, .58);
    color: #d9b5ff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.35;
    text-transform: uppercase;
}

.results-section-label.secondary {
    margin-top: 17px;
    padding-top: 12px;
    border-top: 1px solid rgba(183, 105, 255, .14);
    border-left: 0;
    color: #9f91ae;
}

.metric {
    position: relative;
    padding: 15px 12px;
    margin: 0 -12px;
}

.metric.clickable::after {
    content: "›";
    position: absolute;
    top: 12px;
    right: 12px;
    color: rgba(217, 181, 255, .42);
    font-size: 18px;
    line-height: 1;
}

.metric b {
    font-variant-numeric: tabular-nums;
}

.metric-value-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.cost-metric {
    display: block;
    padding-bottom: 16px;
}

.cost-metric > small {
    display: block;
    margin-bottom: 10px;
    padding-right: 22px;
}

.cost-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cost-value {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 64px;
    padding: 9px;
    border: 1px solid rgba(183, 105, 255, .18);
    border-radius: 13px;
    background: rgba(168, 77, 255, .045);
}

.cost-value-copy {
    min-width: 0;
}

.cost-value b {
    display: block;
    overflow: hidden;
    font-size: 20px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cost-value i {
    display: block;
    margin-top: 3px;
    color: #c8a0ef;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.15;
}

.currency-icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0 !important;
    border-radius: 50%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    align-self: center !important;
}

.currency-icon.currency-ryo {
    background-image: url("./assets/currency-ryo.png");
}

.currency-icon.currency-rellcoins {
    background-image: url("./assets/currency-rellcoins.png");
}

.stat-icon {
    display: inline-block;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0 !important;
    border-radius: 7px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    align-self: auto !important;
}

.stat-icon.stat-chi {
    background-image: url("./assets/stat-chi.png");
}

.stat-icon.stat-nin {
    background-image: url("./assets/stat-nin.png");
}

.stat-icon.stat-tai {
    background-image: url("./assets/stat-tai.png");
}


.requirement-metric {
    display: block;
    padding-bottom: 17px;
}

.requirement-metric > small {
    display: block;
    margin-bottom: 10px;
}

.requirement-chips {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 0;
}

.requirement-chip {
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    gap: 11px;
    min-width: 0;
    min-height: 58px;
    padding: 10px 12px !important;
    border: 1px solid rgba(183, 105, 255, .14);
    border-radius: 10px;
    background: rgba(16, 10, 23, .58);
    color: #d6c9df !important;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.requirement-label {
    display: inline-flex;
    align-items: center !important;
    gap: 9px;
    min-width: 0;
    padding: 0 !important;
    align-self: auto !important;
}

.requirement-chip i {
    color: #a88cbf;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
    letter-spacing: .06em;
}

.requirement-value {
    padding: 0 !important;
    color: #eadcf5 !important;
    font-size: 18px;
    font-weight: 800 !important;
    line-height: 1;
    align-self: auto !important;
    transition: color .3s ease, transform .3s ease;
}

.requirement-value.changed {
    color: #c8a0ef !important;
    transform: scale(1.1);
}

.summary-note {
    margin: 16px 0 0;
    padding: 12px 13px;
    border-left: 2px solid rgba(190, 111, 255, .5);
    border-radius: 0 10px 10px 0;
    background: rgba(168, 77, 255, .055);
    color: #9e91a8;
    font-size: 11px;
    line-height: 1.55;
}

.loading-state,
.error-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px;
    border: 1px solid rgba(183, 105, 255, .22);
    border-radius: 20px;
    background: linear-gradient(155deg, var(--surface-1), var(--surface-2));
    color: #c9bbd4;
    text-align: center;
}

.error-state b {
    color: #ffd0d0;
}

.modal[hidden],
.metric-detail-modal[hidden] {
    display: none !important;
}

.modal-card {
    overscroll-behavior: contain;
}

.modal-card input {
    min-height: 48px;
}

.clear-slot-btn[hidden] {
    display: none !important;
}

.clear-slot-btn.visible:not([hidden]) {
    display: block;
}


.metric-detail-item .info .owner {
    display: block;
    margin-top: 2px;
    color: #746a7e;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: .01em;
}

.metric-detail-item .value {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.metric-detail-item .value .stat-icon,
.metric-detail-item .value .currency-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
}

.toast-notification {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 500;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border: 1px solid rgba(210, 151, 255, .45);
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(38, 23, 51, .98), rgba(13, 8, 18, .99));
    box-shadow: 0 18px 46px rgba(0, 0, 0, .56), 0 0 25px rgba(132, 47, 214, .13);
    color: #f4e9ff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    transform: translate(-50%, 0);
    animation: toast-in .22s ease-out;
}

.toast-notification.leaving {
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: .3s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 2, 5, .8);
    backdrop-filter: blur(9px);
}

.confirm-overlay .box {
    width: min(390px, 100%);
    padding: 22px;
    border: 1px solid rgba(203, 137, 255, .42);
    border-radius: 18px;
    background: linear-gradient(155deg, var(--surface-1), var(--surface-2));
    box-shadow: 0 28px 90px rgba(0, 0, 0, .7);
}

.confirm-overlay h3 {
    margin: 0 0 20px;
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
}

.confirm-overlay .buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.confirm-overlay .yes {
    border-color: rgba(255, 105, 125, .36);
    color: #ffb2bd;
}

@media (max-width: 1050px) {
    .grid-wrapper {
        grid-template-columns: minmax(0, 1fr) 310px;
        gap: 16px;
    }

    .panel {
        padding: 20px;
    }

    .slots-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    header {
        min-height: 220px;
    }

    .grid-wrapper {
        grid-template-columns: 1fr;
    }

    .summary {
        position: static;
        order: -1;
    }

    .summary .metric {
        min-height: 78px;
    }

    .currency-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .requirement-chips {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    header,
    main {
        padding-left: 13px;
        padding-right: 13px;
    }

    header {
        min-height: 205px;
        padding-top: 30px;
    }

    .panel {
        padding: 16px;
        border-radius: 17px;
    }

    .panel-title-row {
        align-items: flex-start;
    }

    .slots-grid,
    .moves-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .slot-card,
    .move-slot {
        min-height: 68px;
    }

    .moves-grid .move-slot:nth-child(9) {
        grid-column: 1 / -1;
    }

    .requirement-chips {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .requirement-chip {
        min-height: 92px;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding: 9px 5px !important;
        text-align: center;
    }

    .requirement-label {
        flex-direction: column;
        gap: 4px;
    }

    .requirement-chip .stat-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .modal {
        align-items: end;
        padding: 10px;
    }

    .modal-card {
        width: 100%;
        max-height: 90dvh;
        border-radius: 18px 18px 12px 12px;
    }

    .result .art {
        width: 40px;
        height: 40px;
    }
}

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

    .moves-grid .move-slot:nth-child(9) {
        grid-column: 1 / -1;
    }

    .slot-card,
    .move-slot {
        min-height: 64px;
    }

    .slot-card.has-gamepass {
        min-height: 82px;
    }
}


/* Mobile and Telegram Mini App refinements. */
@media (max-width: 620px) {
    body::before {
        background-image:
            linear-gradient(180deg, rgba(5, 4, 7, .20), rgba(5, 4, 7, .82) 58%, #050407 100%),
            radial-gradient(circle at 50% 0, rgba(177, 84, 255, .14), transparent 38%),
            url("./assets/wallpaper-mobile.webp");
        background-position: center top;
        background-size: cover;
    }

    header,
    main {
        padding-left: max(13px, calc(10px + var(--tg-safe-left)));
        padding-right: max(13px, calc(10px + var(--tg-safe-right)));
    }

    main {
        padding-bottom: max(90px, calc(74px + env(safe-area-inset-bottom) + var(--tg-safe-bottom)));
    }

    .actions {
        position: relative;
        z-index: 2;
        padding: 7px;
        border: 1px solid rgba(183, 105, 255, .16);
        border-radius: 13px;
        background: rgba(8, 5, 12, .82);
        backdrop-filter: blur(14px);
    }

    .actions button,
    .close-btn,
    .clear-slot-btn {
        min-height: 44px;
    }

    .modal,
    .metric-detail-modal {
        min-height: var(--app-viewport-height);
        padding-bottom: max(10px, calc(8px + env(safe-area-inset-bottom) + var(--tg-safe-bottom)));
    }

    .modal-card,
    .metric-detail-card {
        max-height: calc(var(--app-viewport-height) - max(20px, calc(var(--tg-safe-top) + var(--tg-safe-bottom) + 16px)));
    }

    .metric-detail-card #metricDetailContent {
        max-height: calc(var(--app-viewport-height) - 118px - var(--tg-safe-top) - var(--tg-safe-bottom));
    }

    .result,
    .slot-card,
    .move-slot {
        contain: layout paint;
    }
}

html.miniapp header {
    padding-top: max(18px, calc(12px + var(--tg-safe-top)));
}

html.miniapp .toast-notification {
    bottom: max(18px, calc(10px + env(safe-area-inset-bottom) + var(--tg-safe-bottom)));
}

@media (max-width: 620px) {
    html.miniapp header {
        min-height: 158px;
    }

    html.miniapp .subtitle {
        margin-bottom: 4px;
    }
}

@media (hover: none), (pointer: coarse) {
    .slot-card:hover,
    .move-slot:hover,
    .result:hover,
    .panel:hover,
    button:hover {
        transform: none;
    }
}

/* Mobile/miniapp performance and large currency values. */
@supports (height: 100dvh) {
    :root {
        --app-viewport-height: 100dvh;
    }
}

.scroll-progress {
    width: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

.cost-values {
    grid-template-columns: minmax(0, 1fr);
}

.cost-value {
    min-height: 58px;
}

.cost-value-copy {
    flex: 1 1 auto;
}

.cost-value b {
    overflow: visible;
    font-size: clamp(18px, 2vw, 22px);
    text-overflow: clip;
    white-space: nowrap;
}

.results-list {
    min-width: 0;
}

.results-more {
    display: block;
    width: calc(100% - 16px);
    min-height: 44px;
    margin: 12px 8px 6px;
    border-color: rgba(201, 139, 255, .28);
    background: rgba(168, 77, 255, .09);
    color: #dcc2f3;
    font-size: 12px;
    font-weight: 800;
}

.results-more[hidden] {
    display: none !important;
}

.results-count {
    margin: 8px 8px 4px;
    color: #81758d;
    font-size: 11px;
    text-align: center;
}

@supports (content-visibility: auto) {
    .result {
        content-visibility: auto;
        contain-intrinsic-size: 64px;
    }
}

@media (max-width: 850px) {
    .cost-value b {
        font-size: 22px;
    }
}

@media (max-width: 620px) {
    body::before {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        background-position: center center;
        background-size: cover, cover, cover;
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        contain: strict;
    }

    body::after {
        display: none;
    }

    .panel,
    .slot-card,
    .move-slot,
    button,
    .actions,
    .toast-notification,
    .modal,
    .metric-detail-modal,
    .confirm-overlay {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    .panel {
        background: linear-gradient(155deg, rgba(29, 18, 40, .985), rgba(10, 7, 15, .995));
    }

    .actions {
        background: rgba(8, 5, 12, .96);
    }

    .modal,
    .metric-detail-modal,
    .confirm-overlay {
        background: rgba(3, 2, 6, .94);
    }

    .result {
        contain: layout paint style;
    }

    .cost-value {
        min-height: 62px;
        padding: 10px 12px;
    }

    .cost-value b {
        font-size: clamp(20px, 6vw, 24px);
    }
}

html.miniapp body::before {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: var(--app-viewport-height);
    min-height: 100dvh;
    background-position: center center;
    background-size: cover, cover, cover;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    contain: strict;
}

html.miniapp body::after {
    display: none;
}

html.miniapp .panel,
html.miniapp .slot-card,
html.miniapp .move-slot,
html.miniapp button,
html.miniapp .actions,
html.miniapp .toast-notification,
html.miniapp .modal,
html.miniapp .metric-detail-modal,
html.miniapp .confirm-overlay {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

@media (hover: none), (pointer: coarse) {
    .slot-card,
    .move-slot,
    .result,
    .panel,
    button,
    .metric,
    .requirement-value {
        transition-duration: .01ms !important;
    }

    .slot-card::before,
    .move-slot::before {
        display: none;
    }
}

/* v8: full-viewport wallpapers and readable movement names on mobile/Mini App. */
body::before {
    background-position: center center;
    background-size: cover, cover, cover;
}

@media (max-width: 620px) {
    .moves-grid {
        grid-auto-rows: auto;
        align-items: stretch;
    }

    .move-slot {
        min-height: 108px;
        padding: 8px 7px;
        align-items: stretch;
    }

    .move-slot .item {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
        grid-template-areas:
            "art name"
            ". cooldown";
        align-content: center;
        align-items: start;
        column-gap: 8px;
        row-gap: 6px;
        padding: 5px 3px;
    }

    .move-slot .item .art {
        grid-area: art;
        width: 38px;
        height: 38px;
        align-self: start;
    }

    .move-slot .item .iname {
        grid-area: name;
        overflow: visible;
    }

    .move-slot .item .iname b {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        line-height: 1.22;
        font-size: 12px;
    }

    .move-slot .item .iname small {
        margin-top: 4px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        line-height: 1.2;
        font-size: 9px;
    }

    .move-slot .item .cooldown {
        grid-area: cooldown;
        justify-self: end;
        margin: 0;
        padding: 0;
        font-size: 10px;
    }
}

html.miniapp .moves-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: stretch;
}

html.miniapp .moves-grid .move-slot:nth-child(9) {
    grid-column: 1 / -1;
}

html.miniapp .move-slot {
    min-height: 108px;
    padding: 8px 7px;
    align-items: stretch;
}

html.miniapp .move-slot .item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
        "art name"
        ". cooldown";
    align-content: center;
    align-items: start;
    column-gap: 8px;
    row-gap: 6px;
    padding: 5px 3px;
}

html.miniapp .move-slot .item .art {
    grid-area: art;
    width: 38px;
    height: 38px;
    align-self: start;
}

html.miniapp .move-slot .item .iname {
    grid-area: name;
    overflow: visible;
}

html.miniapp .move-slot .item .iname b {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.22;
    font-size: 12px;
}

html.miniapp .move-slot .item .iname small {
    margin-top: 4px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.2;
    font-size: 9px;
}

html.miniapp .move-slot .item .cooldown {
    grid-area: cooldown;
    justify-self: end;
    margin: 0;
    padding: 0;
    font-size: 10px;
}

@media (max-width: 340px) {
    .moves-grid,
    html.miniapp .moves-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .moves-grid .move-slot:nth-child(9),
    html.miniapp .moves-grid .move-slot:nth-child(9) {
        grid-column: auto;
    }
}

