:root {
    color-scheme: dark;
}

body.papiplay-v2 {
    background: #020d06;
    overflow: hidden;
    color: transparent;
    font-size: 0;
}

body.papiplay-v2 .background-image {
    background-image:
        radial-gradient(circle at 50% -8%, rgba(34, 255, 100, 0.18), transparent 35%),
        radial-gradient(circle at 80% 72%, rgba(255, 199, 37, 0.08), transparent 29%),
        url('./asset/background.png');
    filter: saturate(1.08) contrast(1.08) brightness(0.52);
    transform: scale(1.04);
}

body.papiplay-v2 .background-image::before {
    opacity: 0.72;
    background:
        linear-gradient(rgba(66, 255, 112, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(66, 255, 112, 0.022) 1px, transparent 1px);
    background-size: 28px 28px;
    filter: none;
    animation: v2GridMove 16s linear infinite;
}

body.papiplay-v2 .background-image::after {
    opacity: 0.22;
    background: linear-gradient(112deg, transparent 0 42%, rgba(137, 255, 166, 0.12) 49%, transparent 56%);
    background-size: 220% 100%;
    animation: v2LightSweep 8s linear infinite;
}

body.papiplay-v2 #game-container {
    display: none !important;
}

body.papiplay-v2 .v2-home {
    --green: #54ff78;
    --green-soft: #20d85c;
    --yellow: #ffd43b;
    --ink: #031109;
    position: fixed;
    z-index: 20;
    top: 50%;
    left: 50%;
    width: min(100vw, 480px);
    height: min(100svh, 800px);
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: clamp(9px, 1.45vh, 13px);
    padding: clamp(10px, 1.8vh, 16px);
    overflow: hidden;
    isolation: isolate;
    font-family: 'Bungee', 'Arial Black', system-ui, sans-serif;
    color: #f3ffe9;
    font-size: 16px;
    background:
        linear-gradient(180deg, rgba(5, 44, 18, 0.96), rgba(2, 24, 10, 0.97)),
        url('./asset/background.png') center / cover;
    border-inline: 1px solid rgba(93, 255, 132, 0.15);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.32),
        0 28px 90px rgba(0, 0, 0, 0.55);
}

body.papiplay-v2 .v2-home::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0 49.8%, rgba(82, 255, 123, 0.045) 50%, transparent 50.2%),
        radial-gradient(circle at 16% 10%, rgba(82, 255, 123, 0.12), transparent 25%);
}

body.papiplay-v2 .v2-home__glow {
    position: absolute;
    z-index: -1;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.12;
    pointer-events: none;
}

body.papiplay-v2 .v2-home__glow--top {
    top: -120px;
    left: -80px;
    background: var(--green);
}

body.papiplay-v2 .v2-home__glow--bottom {
    right: -100px;
    bottom: -120px;
    background: var(--yellow);
}

body.papiplay-v2 .v2-surface {
    position: relative;
    border: 1px solid rgba(109, 255, 143, 0.16);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.065), transparent 42%),
        rgba(0, 21, 8, 0.58);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 12px 28px rgba(0, 9, 3, 0.18);
    backdrop-filter: blur(14px);
}

body.papiplay-v2 .v2-header {
    min-height: 74px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px 9px 16px;
    animation: v2Enter 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.papiplay-v2 .v2-logo {
    display: block;
    width: min(55%, 235px);
    height: 52px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.32));
}

body.papiplay-v2 .v2-header__actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

body.papiplay-v2 button {
    font: inherit;
}

body.papiplay-v2 .v2-icon-button {
    width: 54px;
    height: 54px;
    padding: 8px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(87, 255, 127, 0.25);
    border-radius: 17px;
    background: rgba(0, 25, 9, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

body.papiplay-v2 .v2-icon-button:active {
    transform: scale(0.92);
}

body.papiplay-v2 .v2-icon-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.papiplay-v2 .v2-rank-button {
    border-color: rgba(255, 212, 59, 0.28);
}

body.papiplay-v2 .v2-profile {
    min-height: 72px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 44px 66px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 20px;
    animation: v2Enter 560ms 60ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.papiplay-v2 .v2-avatar {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    padding: 3px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #aaffbc, #3be96c);
    box-shadow: 0 0 0 3px rgba(68, 255, 111, 0.1), 0 9px 20px rgba(0, 0, 0, 0.22);
}

body.papiplay-v2 .v2-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(0, 22, 8, 0.9);
}

body.papiplay-v2 .v2-profile__identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.05;
}

body.papiplay-v2 .v2-eyebrow {
    color: #68f78d;
    font-family: system-ui, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.3px;
}

body.papiplay-v2 .v2-profile__identity strong {
    color: #f5ffe9;
    font-size: clamp(12px, 3.35vw, 17px);
    letter-spacing: -0.25px;
    white-space: nowrap;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32);
}

body.papiplay-v2 .v2-profile__identity small {
    margin-top: 4px;
    overflow: hidden;
    color: rgba(220, 255, 227, 0.56);
    font-family: system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.papiplay-v2 .v2-copy-button {
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid rgba(93, 255, 132, 0.18);
    border-radius: 14px;
    background: rgba(17, 112, 45, 0.28);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

body.papiplay-v2 .v2-copy-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.papiplay-v2 .v2-copy-button.is-copied {
    transform: scale(0.9);
    background: rgba(65, 255, 110, 0.32);
}

body.papiplay-v2 .v2-level {
    width: 66px;
    height: 66px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.27));
}

body.papiplay-v2 .v2-wallets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    animation: v2Enter 560ms 120ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.papiplay-v2 .v2-wallet {
    position: relative;
    min-width: 0;
    min-height: 112px;
    padding: 8px 8px 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(91, 255, 129, 0.16);
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 13%, rgba(68, 255, 111, 0.15), transparent 35%),
        linear-gradient(145deg, rgba(11, 68, 27, 0.88), rgba(1, 26, 9, 0.93));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 24px rgba(0, 8, 3, 0.2);
}

body.papiplay-v2 .v2-wallet::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 70px;
    height: 70px;
    border: 1px solid rgba(111, 255, 145, 0.11);
    border-radius: 50%;
}

body.papiplay-v2 .v2-wallet--ticket {
    border-color: rgba(255, 203, 52, 0.2);
}

body.papiplay-v2 .v2-wallet--ticket::after {
    border-color: rgba(255, 203, 52, 0.13);
}

body.papiplay-v2 .v2-wallet__icon {
    width: min(82px, 76%);
    height: 72px;
    flex: 1 1 auto;
    display: grid;
    place-items: center;
}

body.papiplay-v2 .v2-wallet__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.28));
}

body.papiplay-v2 .v2-wallet strong {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    margin-top: 1px;
    transform: translateY(2px);
    overflow: hidden;
    color: #f7ffe9;
    font-size: clamp(14px, 4vw, 19px);
    text-overflow: ellipsis;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32);
}

body.papiplay-v2 .v2-games {
    min-height: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    animation: v2Enter 560ms 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.papiplay-v2 .v2-section-heading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

body.papiplay-v2 .v2-section-heading h1 {
    margin: 3px 0 0;
    color: #f3ffe9;
    font-size: clamp(18px, 5vw, 24px);
    line-height: 1;
    letter-spacing: 0.2px;
}

body.papiplay-v2 .v2-section-heading h1 em {
    display: inline-grid;
    min-width: 25px;
    height: 25px;
    margin-left: 4px;
    place-items: center;
    border-radius: 9px;
    color: #082311;
    background: var(--green);
    font-size: 12px;
    font-style: normal;
    vertical-align: 3px;
    box-shadow: 0 0 18px rgba(84, 255, 120, 0.22);
}

body.papiplay-v2 .v2-slider-actions {
    display: flex;
    gap: 7px;
}

body.papiplay-v2 .v2-slider-actions button {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 212, 59, 0.28);
    border-radius: 13px;
    color: #071b0d;
    background: linear-gradient(145deg, #ffe560, #f0b914);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-family: system-ui, sans-serif;
    font-size: 29px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: transform 150ms ease;
}

body.papiplay-v2 .v2-slider-actions button:active {
    transform: scale(0.9);
}

body.papiplay-v2 .v2-game-track {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(126px, 35%, 148px);
    align-items: stretch;
    gap: 11px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

body.papiplay-v2 .v2-game-track::-webkit-scrollbar {
    display: none;
}

body.papiplay-v2 .v2-game-card {
    position: relative;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid rgba(88, 255, 126, 0.32);
    border-radius: 20px;
    background: #06150b;
    box-shadow: 0 13px 26px rgba(0, 5, 1, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: pointer;
    text-decoration: none;
    transform: translateZ(0);
    transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

body.papiplay-v2 .v2-game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 24% 72%, rgba(0, 0, 0, 0.17));
}

body.papiplay-v2 .v2-game-card img,
body.papiplay-v2 .v2-game-card video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), filter 180ms ease;
}

body.papiplay-v2 .v2-game-card video {
    pointer-events: none;
    background: #06150b;
}

body.papiplay-v2 .v2-game-card__video--sloty {
    transform: scaleY(1.58);
    transform-origin: center center;
}

body.papiplay-v2 .v2-game-card > span {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 8px;
    padding: 5px 8px;
    border-radius: 999px;
    color: #04200b;
    background: var(--green);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25), 0 0 16px rgba(84, 255, 120, 0.25);
    font-family: system-ui, sans-serif;
    font-size: 8px;
    font-weight: 1000;
    letter-spacing: 0.7px;
}

@media (hover: hover) {
    body.papiplay-v2 .v2-icon-button:hover {
        transform: translateY(-2px);
        border-color: rgba(93, 255, 132, 0.52);
        background: rgba(14, 85, 34, 0.65);
    }

    body.papiplay-v2 .v2-game-card:hover {
        transform: translateY(-5px);
        border-color: rgba(98, 255, 135, 0.7);
        filter: brightness(1.05);
    }

    body.papiplay-v2 .v2-game-card:hover img,
    body.papiplay-v2 .v2-game-card:hover video {
        transform: scale(1.035);
    }

    body.papiplay-v2 .v2-game-card:hover .v2-game-card__video--sloty {
        transform: scaleY(1.58) scale(1.035);
    }
}

body.papiplay-v2 .v2-game-card:active,
body.papiplay-v2 .v2-game-card.is-launching {
    transform: scale(0.96);
    filter: brightness(1.14);
}

body.papiplay-v2 .v2-community {
    width: min(60%, 250px);
    height: auto;
    aspect-ratio: 702 / 180;
    justify-self: center;
    display: block;
    border-radius: 17px;
    transition: transform 170ms ease, filter 170ms ease;
    animation: v2Enter 560ms 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.papiplay-v2 .v2-community:active {
    transform: scale(0.95);
}

body.papiplay-v2 .v2-community img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25));
}

body.papiplay-v2 .v2-top5-modal[hidden] {
    display: none !important;
}

body.papiplay-v2 .v2-top5-modal {
    position: absolute;
    z-index: 30;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
}

body.papiplay-v2 .v2-top5-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 10, 3, 0.78);
    backdrop-filter: blur(12px);
    cursor: pointer;
}

body.papiplay-v2 .v2-top5-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 410px);
    overflow: hidden;
    border: 1px solid rgba(99, 255, 136, 0.3);
    border-radius: 26px;
    background:
        radial-gradient(circle at 90% 2%, rgba(255, 211, 55, 0.13), transparent 30%),
        linear-gradient(155deg, rgba(8, 58, 22, 0.98), rgba(1, 22, 8, 0.99));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: v2Top5In 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.papiplay-v2 .v2-top5-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(104, 255, 139, 0.12);
}

body.papiplay-v2 .v2-top5-panel h2 {
    margin: 5px 0 0;
    color: #f4ffe9;
    font-size: clamp(18px, 5vw, 23px);
    line-height: 1;
}

body.papiplay-v2 .v2-top5-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(98, 255, 134, 0.2);
    border-radius: 14px;
    color: #ebffe7;
    background: rgba(10, 81, 31, 0.5);
    font-family: system-ui, sans-serif;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

body.papiplay-v2 .v2-top5-list {
    margin: 0;
    padding: 12px;
    list-style: none;
}

body.papiplay-v2 .v2-top5-list li {
    min-height: 60px;
    display: grid;
    grid-template-columns: 30px 45px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 17px;
}

body.papiplay-v2 .v2-top5-list li:nth-child(-n+3) {
    border-color: rgba(255, 211, 55, 0.11);
    background: linear-gradient(90deg, rgba(255, 211, 55, 0.07), transparent);
}

body.papiplay-v2 .v2-top5-list li > b {
    color: #ffd748;
    font-size: 18px;
    text-align: center;
}

body.papiplay-v2 .v2-top5-list li > img {
    width: 44px;
    height: 44px;
    padding: 2px;
    object-fit: contain;
    border: 1px solid rgba(96, 255, 133, 0.3);
    border-radius: 14px;
    background: rgba(0, 23, 8, 0.85);
}

body.papiplay-v2 .v2-top5-list li > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.papiplay-v2 .v2-top5-list li strong {
    overflow: hidden;
    color: #efffe9;
    font-family: system-ui, sans-serif;
    font-size: 14px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.papiplay-v2 .v2-top5-list li span {
    color: rgba(215, 255, 223, 0.55);
    font-family: system-ui, sans-serif;
    font-size: 10px;
    font-weight: 800;
}

body.papiplay-v2 .v2-top5-list .v2-top5-empty {
    display: block;
    padding: 22px;
    color: rgba(225, 255, 230, 0.62);
    font-family: system-ui, sans-serif;
    font-size: 13px;
    text-align: center;
}

body.papiplay-v2 .v2-toast {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 74px;
    padding: 9px 13px;
    border: 1px solid rgba(101, 255, 137, 0.3);
    border-radius: 12px;
    color: #eaffdf;
    background: rgba(0, 23, 8, 0.92);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-family: system-ui, sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.7px;
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

body.papiplay-v2 .v2-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@keyframes v2Enter {
    from { opacity: 0; transform: translateY(13px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes v2GridMove {
    from { background-position: 0 0, 0 0; }
    to { background-position: 28px 28px, 28px 28px; }
}

@keyframes v2LightSweep {
    from { background-position: 170% 0; }
    to { background-position: -130% 0; }
}

@keyframes v2Top5In {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-height: 680px) {
    body.papiplay-v2 .v2-home {
        gap: 7px;
        padding: 8px;
    }

    body.papiplay-v2 .v2-header { min-height: 62px; }
    body.papiplay-v2 .v2-logo { height: 45px; }
    body.papiplay-v2 .v2-icon-button { width: 45px; height: 45px; border-radius: 14px; }
    body.papiplay-v2 .v2-profile { min-height: 62px; grid-template-columns: 44px minmax(0, 1fr) 38px 55px; }
    body.papiplay-v2 .v2-avatar { width: 44px; height: 44px; border-radius: 14px; }
    body.papiplay-v2 .v2-copy-button { width: 36px; height: 36px; }
    body.papiplay-v2 .v2-level { width: 54px; height: 54px; }
    body.papiplay-v2 .v2-wallet { min-height: 92px; }
    body.papiplay-v2 .v2-wallet__icon { width: min(68px, 72%); height: 58px; }
    body.papiplay-v2 .v2-games { padding: 9px; }
    body.papiplay-v2 .v2-section-heading { margin-bottom: 6px; }
    body.papiplay-v2 .v2-section-heading h1 { font-size: 17px; }
    body.papiplay-v2 .v2-community { width: min(57%, 225px); height: auto; }
}

@media (max-width: 360px) {
    body.papiplay-v2 .v2-home {
        gap: 8px;
        padding: 8px;
    }

    body.papiplay-v2 .v2-wallet { padding-inline: 7px; }

    body.papiplay-v2 .v2-wallet__icon {
        width: min(62px, 70%);
        height: 54px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.papiplay-v2 *,
    body.papiplay-v2 *::before,
    body.papiplay-v2 *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
