/* general styling */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body.blank-page {
            background: var(--primary-color);
            font-family: 'Roboto', 'helvetica', Arial, sans-serif;
            font-size: 10px;
            min-height: 100dvh;
            overflow: hidden;
            user-select: auto;
            touch-action: auto;
            display: grid;
            grid-template-rows: var(--header-h) 1fr;
        }

        .blank-content {
            min-height: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 16px 16px;
            overflow: auto;
        }

        .blank-content__inner {
            width: 100%;
            max-width: 800px;
            min-height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .game-container {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .topbar__actions {
            gap: 8px;
        }

        .controls {
            margin: 1.5rem auto 2rem;
            max-width: 600px;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 1rem;
            font-size: 1.15rem;
            font-family: 'helvetica', Arial, sans-serif;
            transition: all 0.3s;
            color: #E4D9FF;
        }

        .memory-hidden-stat {
            display: none;
        }

        .moves-container {
            min-width: 96px;
            text-align: center;
        }

        .memory-how-to-link {
            color: #E4D9FF;
            text-decoration: none;
            font-family: 'Roboto', 'helvetica', Arial, sans-serif;
        }

        .status-modal__content {
            display: block;
            text-align: left;
        }

        .how-to-play-p {
            margin: 0 0 14px;
            color: var(--line-color);
            font-size: 0.95rem;
            line-height: 1.5;
        }

        .status-card {
            margin-bottom: 10px;
            padding: 16px;
            border: 2px solid var(--line-color);
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.06);
            text-align: left;
        }

        .status-card__label {
            display: block;
            margin-bottom: 6px;
            color: var(--line-color);
            font-family: 'Roboto', 'helvetica', Arial, sans-serif;
            font-size: 1rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        .status-card__value {
            display: block;
            color: var(--line-color);
            font-family: 'Roboto', 'helvetica', Arial, sans-serif;
            font-size: 14px;
            font-weight: 700;
            line-height: 1.5;
            text-align: left;
        }

        .memory-status-modal .cm-theme-modal__panel {
            width: min(92vw, 640px);
            padding: 22px;
            border-radius: 16px;
            background: var(--primary-color);
        }

        .memory-status-modal .cm-theme-modal__header {
            margin-bottom: 24px;
        }

        .memory-status-modal .cm-theme-modal__title {
            font-size: 1.35rem;
            font-weight: 800;
        }

        .memory-status-list {
            display: grid;
            gap: 14px;
        }

        .memory-status-list .status-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0;
            padding: 16px 18px;
            border: 2px solid var(--line-color);
            border-radius: 14px;
        }

        .memory-status-list .status-card__label,
        .memory-status-list .status-card__value {
            margin: 0;
            font-size: 1rem;
            font-weight: 800;
            line-height: 1;
            text-transform: none;
        }

        .memory-complete-links {
            margin-top: 30px;
            display: grid;
            justify-items: center;
            gap: 24px;
            color: var(--line-color);
            font-family: 'Roboto', 'helvetica', Arial, sans-serif;
            font-size: 1rem;
            font-weight: 800;
        }

        .memory-complete-links a,
        .memory-complete-links button {
            border: 0;
            background: transparent;
            color: var(--line-color);
            font: inherit;
            text-decoration: underline;
            cursor: pointer;
        }

        .memory-share-title {
            font-size: 1.25rem;
            text-decoration: none;
        }

        .memory-share-actions {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 28px;
            margin-top: -14px;
        }

        .memory-share-actions button {
            position: relative;
            width: 28px;
            height: 28px;
            padding: 0;
            text-decoration: none;
            font-size: 1.3rem;
        }

        .memory-share-actions button.copied {
            animation: flash 0.4s ease;
        }

        .memory-copy-feedback {
            position: absolute;
            left: 50%;
            bottom: calc(100% + 4px);
            transform: translateX(-50%);
            color: var(--line-color);
            font-size: 0.7rem;
            line-height: 1;
            opacity: 0;
            pointer-events: none;
            text-decoration: none;
            transition: opacity 0.2s ease;
            white-space: nowrap;
        }

        .memory-share-actions button.copied .memory-copy-feedback {
            opacity: 1;
        }

        .hide-start-btn {
            display: none;
        }

        /* card ddeck styling */

        .deck {
            --memory-columns: 4;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(var(--memory-columns), minmax(0, 1fr));
            gap: 12px;
            justify-content: center;
            align-items: center;
            width: min(100%, calc(var(--memory-columns) * 136px + (var(--memory-columns) - 1) * 12px));
        }

        .deck[data-card-count="20"] {
            --memory-columns: 5;
        }

        .deck[data-card-count="24"] {
            --memory-columns: 6;
        }

        .card {
            list-style: none;
            width: 100%;
            height: auto;
            aspect-ratio: 1 / 1;
            color: #1E2749;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 10px;
            perspective: 500px;
            background: transparent;
            box-shadow: none;
            transform-origin: center;
            transition: all 0.5s;
        }

        .card:not(.cant-click-this),
        .card-container:not(.cant-click-this),
        .card-face {
            cursor: pointer;
        }

        .cant-click-this,
        .cant-click-this * {
            cursor: default;
        }

        .card-container {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
            border-radius: 10px;
            position: relative;
            transition: all 0.5s;
            transform-style: preserve-3d;
        }

        .card-face {
            position: absolute;
            border-radius: 10px;
            height: 100%;
            width: 100%;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            background: var(--primary-color);
            border: 3px solid var(--line-color);
        }

        /* .front {
            background: var(--primary-color)
        } */

        .back {
            background: #fff;
            transform: rotateY(180deg);
        }

        .fab {
            font-size: 5rem;
            line-height: 1.9;
            text-align: center;
        }

        .memory-card-image {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 7px;
            pointer-events: none;
        }

        .memory-empty {
            width: min(520px, calc(100vw - 32px));
            color: var(--line-color);
            font-family: 'Roboto', 'helvetica', Arial, sans-serif;
            font-size: 1rem;
            font-weight: 700;
            line-height: 1.5;
            text-align: center;
        }

        .card-container.flipped {
            transform: rotateY(180deg);
        }

        .cant-click-this {
            pointer-events: none;
        }

        .wrong {
            animation: wrong 0.25s ease-in-out;
        }

        .card-container.flipped.wrong {
            animation: wrong-flipped 0.25s ease-in-out;
        }

        @keyframes wrong {
            0% {
                transform: rotate(0);
            }

            25% {
                transform: rotate(-15deg);
            }

            50% {
                transform: rotate(0);
            }

            75% {
                transform: rotate(15deg);
            }

            100% {
                transform: rotate(0);
            }
        }

        @keyframes wrong-flipped {
            0% {
                transform: rotateY(180deg) rotate(0);
            }

            25% {
                transform: rotateY(180deg) rotate(-15deg);
            }

            50% {
                transform: rotateY(180deg) rotate(0);
            }

            75% {
                transform: rotateY(180deg) rotate(15deg);
            }

            100% {
                transform: rotateY(180deg) rotate(0);
            }
        }

        .correct {
            animation: correct 0.3s ease-in-out;
        }

        @keyframes correct {
            0% {
                transform: scaleX(1) scaleY(1);
            }

            50% {
                transform: scaleX(1.15) scaleY(1.1);
            }

            100% {
                transform: scaleX(1) scaleY(1);
            }
        }

        .star,
        .moves,
        .seconds {
            font-weight: bold;
        }

        /* resposivness */
        @media screen and (max-width: 650px) {

            .deck {
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 10px;
                width: min(calc(100vw - 32px), 520px);
                min-height: 0;
                align-items: stretch;
                justify-content: center;
            }

            .card {
                width: 100%;
                height: auto;
                aspect-ratio: 1 / 1;
                margin: 0;
            }

            .fab {
                font-size: clamp(2.2rem, 12vw, 4.5rem);
                line-height: 1.9;
            }

            .controls {
                width: min(500px, calc(100vw - 24px));
            }
        }

        @media screen and (max-width: 525px) {

            .deck {
                gap: 8px;
            }

            .controls {
                width: min(500px, calc(100vw - 24px));
            }
        }

        @media screen and (max-width: 450px) {

            .deck {
                gap: 6px;
            }

            .controls {
                width: min(400px, calc(100vw - 24px));
            }
        }
