* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --page-width: 375px;
    --design-scale: 0.3472222222;
    --cp-red: #c52d45;
    --cp-dark-red: #8c2130;
    --cp-panel-text: #a8302b;
    --cp-panel-sub: #d26984;
    --cp-cream: #fff2f3;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    background: var(--cp-red);
    color: #fff;
    font-family:
        'Source Han Sans SC', 'Noto Sans CJK SC', Arial, 'Helvetica Neue',
        Helvetica, sans-serif;
}

button {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    outline: none;
}

.app-viewport {
    position: relative;
    width: var(--page-width);
    max-width: 768px;
    min-height: 1300px;
    margin: 0 auto;
    overflow: hidden;
}

.page {
    position: relative;
    width: var(--page-width);
    max-width: 768px;
    min-height: 1300px;
    overflow: hidden;
    background: var(--cp-red);
}

.stage-wrap {
    position: relative;
    width: var(--page-width);
    max-width: 768px;
    height: 1487px;
    overflow: hidden;
    background: var(--cp-red);
}

.stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 1080px;
    min-height: 4283px;
    overflow: hidden;
    transform: scale(var(--design-scale));
    transform-origin: top left;
    background: var(--cp-red);
}

.stage > * {
    position: absolute;
}

.hero-bg {
    left: 0;
    top: 0;
    z-index: 0;
    width: 1080px;
    height: 1919px;
    object-fit: cover;
    pointer-events: none;
    transform: scale(1.04);
    transform-origin: top center;
}

.language-switcher {
    z-index: 20;
    top: 38px;
    right: 36px;
    width: 188px;
    direction: ltr;
}

.language-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 78px;
    margin-left: auto;
    border: 2px solid rgba(255, 236, 238, 0.72);
    border-radius: 999px;
    background: rgba(152, 30, 51, 0.52);
    box-shadow:
        inset 0 0 16px rgba(255, 210, 220, 0.3),
        0 10px 20px rgba(78, 4, 16, 0.28);
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    line-height: 32px;
    letter-spacing: 0;
}

.language-menu {
    position: absolute;
    top: 92px;
    right: 0;
    z-index: 22;
    width: 188px;
    overflow: hidden;
    border: 2px solid rgba(255, 236, 238, 0.7);
    border-radius: 18px;
    background: rgba(121, 14, 33, 0.94);
    box-shadow: 0 18px 32px rgba(87, 1, 17, 0.36);
}

.language-menu button {
    display: block;
    width: 100%;
    height: 58px;
    color: #fff0f3;
    font-size: 28px;
    font-weight: 800;
}

.language-menu button.is-active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffe184;
}

.countdown {
    left: 48px;
    top: 1521px;
    z-index: 2;
    width: 974px;
    height: 106px;
}

.time-unit {
    position: relative;
    width: 166px;
    height: 106px;
}

.countdown > .time-unit {
    position: absolute;
    top: 0;
}

.countdown > .time-unit:nth-child(1) {
    left: 0;
}

.countdown > .time-unit:nth-child(2) {
    left: 250px;
}

.countdown > .time-unit:nth-child(3) {
    left: 501px;
}

.countdown > .time-unit:nth-child(4) {
    left: 756px;
}

.time-unit img {
    position: absolute;
    inset: 0;
    width: 166px;
    height: 106px;
    object-fit: fill;
}

.time-unit strong {
    position: absolute;
    left: 0;
    top: 23px;
    width: 166px;
    color: #fff;
    font-size: 40px;
    font-weight: 900;
    line-height: 42px;
    text-align: center;
    text-shadow:
        0 2px 0 rgba(119, 16, 30, 0.6),
        0 0 12px rgba(255, 255, 255, 0.46);
}

.time-unit span {
    position: absolute;
    left: 193px;
    top: 25px;
    width: 42px;
    color: #fff;
    font-size: 36px;
    font-weight: 900;
    line-height: 40px;
    text-align: center;
    text-shadow: 0 2px 0 rgba(116, 9, 27, 0.62);
}

.tabs {
    left: 40px;
    top: 1683px;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(3, 303px);
    column-gap: 46px;
    width: 1000px;
    height: 93px;
    direction: ltr;
}

.tab {
    position: relative;
    width: 303px;
    height: 93px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 40px;
    font-weight: 900;
    line-height: 44px;
    text-align: center;
    text-shadow: 0 2px 0 rgba(105, 30, 36, 0.55);
}

.tab img {
    position: absolute;
    inset: 0;
    width: 303px;
    height: 93px;
    object-fit: fill;
}

.tab span {
    position: absolute;
    left: 0;
    top: 25px;
    width: 303px;
    overflow: hidden;
    white-space: nowrap;
    unicode-bidi: plaintext;
}

.tab.is-active {
    color: #fff;
}

.tab-content {
    left: 0;
    top: 0;
    z-index: 3;
    width: 1080px;
}

.copyright {
    left: 114px;
    z-index: 3;
    width: 850px;
    height: 30px;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    text-align: center;
}

.ornate-panel {
    position: absolute;
    left: 60px;
    width: 960px;
    overflow: hidden;
    border: 8px solid #f62658;
    border-radius: 48px;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(255, 255, 255, 0.98) 0,
            rgba(255, 255, 255, 0.86) 23%,
            rgba(255, 232, 236, 0.92) 100%
        ),
        linear-gradient(180deg, #fff8f8 0%, #ffe6eb 100%);
    box-shadow:
        inset 0 0 0 4px rgba(255, 204, 119, 0.95),
        inset 0 0 0 12px rgba(255, 255, 255, 0.82),
        inset 0 0 24px rgba(255, 75, 113, 0.22),
        0 0 0 2px rgba(255, 237, 180, 0.92),
        0 0 16px rgba(255, 34, 87, 0.45);
    color: var(--cp-panel-text);
}

.ornate-panel::after {
    position: absolute;
    content: '';
    pointer-events: none;
}

.ornate-panel::after {
    left: 70px;
    right: 70px;
    top: 0;
    z-index: 1;
    height: 14px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 241, 177, 0.95),
        transparent
    );
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

.panel-top,
.panel-bottom,
.panel-mid {
    display: none;
}

.panel-top {
    top: 0;
    height: 90px;
}

.panel-bottom {
    bottom: 0;
    height: 86px;
}

.panel-mid {
    top: 89px;
    bottom: 85px;
    background-image: url('./assets/panel-mid.png');
    background-size: 960px 184px;
    background-repeat: repeat-y;
}

.panel-body {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.plaza-panel-a {
    top: 1816px;
    height: 1152px;
}

.plaza-panel-b {
    top: 3024px;
    height: 1126px;
}

.plaza-panel-a .cp-list,
.plaza-panel-b .cp-list {
    top: 170px;
}

.plaza-carousel-viewport {
    position: absolute;
    left: 60px;
    top: 170px;
    width: 840px;
    height: 868px;
    overflow: hidden;
}

.plaza-carousel-track {
    width: 840px;
    will-change: auto;
}

.plaza-carousel-track.is-looping {
    animation: plaza-carousel-scroll var(--plaza-loop-duration) linear infinite;
    will-change: transform;
}

.plaza-carousel-set {
    display: grid;
    row-gap: 24px;
    width: 840px;
    padding-bottom: 24px;
}

@keyframes plaza-carousel-scroll {
    to {
        transform: translateY(calc(-1 * var(--plaza-loop-distance)));
    }
}

.panel-title {
    position: absolute;
    left: 55px;
    top: 70px;
    width: 850px;
    margin: 0;
    color: var(--cp-panel-text);
    font-size: 36px;
    font-weight: 800;
    line-height: 46px;
    text-align: center;
}

.panel-subtitle {
    position: absolute;
    left: 55px;
    top: 161px;
    width: 850px;
    margin: 0;
    color: var(--cp-panel-sub);
    font-size: 24px;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
}

.cp-list {
    position: absolute;
    left: 60px;
    top: 224px;
    display: grid;
    row-gap: 24px;
    width: 840px;
}

.cp-row {
    position: relative;
    width: 840px;
    height: 199px;
    border-radius: 24px;
    background: rgba(197, 45, 69, 0.12);
}

.avatar {
    position: absolute;
    overflow: hidden;
    border-radius: 50%;
    background: #ffd6df;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-row .avatar {
    top: 28px;
    width: 113px;
    height: 113px;
}

.cp-row .avatar-left {
    left: 42px;
}

.cp-row .avatar-right {
    right: 42px;
}

.cp-row .name {
    position: absolute;
    top: 146px;
    width: 144px;
    overflow: hidden;
    color: #9f1c32;
    font-size: 26px;
    font-weight: 800;
    line-height: 30px;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;
}

.cp-row .name-left {
    left: 42px;
}

.cp-row .name-right {
    right: 42px;
}

.gift-center {
    position: absolute;
    left: 344px;
    top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 144px;
    height: 144px;
}

.gift-center img {
    max-width: 152px;
    max-height: 152px;
    object-fit: contain;
}

.score-heart {
    position: absolute;
    left: 308px;
    top: 28px;
    width: 222px;
    height: 143px;
    object-fit: contain;
}

.score-value {
    position: absolute;
    left: 308px;
    top: 71px;
    width: 222px;
    height: 36px;
    color: #fff7f7;
    font-size: 30px;
    font-weight: 900;
    line-height: 36px;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-shadow:
        0 2px 0 #a51f32,
        0 0 8px rgba(255, 255, 255, 0.32);
}

.deco-line {
    position: absolute;
    top: 70px;
    width: 159px;
    height: 30px;
    object-fit: fill;
    opacity: 0.9;
}

.deco-left {
    left: 252px;
}

.deco-right {
    right: 252px;
    transform: scaleX(-1);
}

.rank-podium {
    position: absolute;
    left: 0;
    top: 1816px;
    width: 1080px;
    height: 580px;
}

.podium-card {
    position: absolute;
    width: 716px;
    height: 288px;
}

.podium-card.rank-1 {
    left: 182px;
    top: 14px;
}

.podium-card.rank-2 {
    left: -34px;
    top: 332px;
    transform: scale(0.77);
    transform-origin: top left;
}

.podium-card.rank-3 {
    left: 565px;
    top: 332px;
    transform: scale(0.77);
    transform-origin: top left;
}

.podium-bg {
    position: absolute;
    inset: 0;
    width: 716px;
    height: 288px;
    object-fit: contain;
}

.podium-crown {
    position: absolute;
    left: 310px;
    top: -8px;
    width: 120px;
    height: 106px;
    object-fit: contain;
}

.podium-card.rank-2 .podium-crown,
.podium-card.rank-3 .podium-crown {
    top: -2px;
    width: 104px;
    height: 90px;
}

.podium-avatar {
    position: absolute;
    top: 92px;
    width: 104px;
    height: 104px;
    border: 5px solid #ffd5a3;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.42);
}

.podium-avatar.left {
    left: 236px;
}

.podium-avatar.right {
    left: 386px;
}

.podium-names {
    position: absolute;
    left: 146px;
    top: 214px;
    display: grid;
    grid-template-columns: repeat(2, 168px);
    column-gap: 64px;
    width: 400px;
    color: #fff3f5;
    font-size: 28px;
    font-weight: 800;
    line-height: 32px;
    text-align: center;
    text-shadow: 0 2px 0 rgba(126, 15, 31, 0.62);
}

.rank-panel {
    top: 2430px;
    height: 1107px;
}

.rank-panel .countdown-inline {
    position: absolute;
    left: 110px;
    top: 64px;
    display: grid;
    grid-template-columns: repeat(4, 166px);
    column-gap: 44px;
    width: 830px;
}

.rank-panel .cp-list {
    top: 252px;
}

.reward-panel {
    height: 912px;
}

.reward-panel.reward-a {
    top: 1816px;
}

.reward-panel.reward-b {
    top: 2784px;
}

.reward-panel.reward-c {
    top: 3752px;
}

.reward-crown {
    position: absolute;
    left: 390px;
    top: 58px;
    width: 180px;
    height: 158px;
    object-fit: contain;
}

.reward-grid {
    position: absolute;
    left: 50%;
    top: 220px;
    display: grid;
    grid-template-columns: repeat(3, 217px);
    gap: 24px 84px;
    width: 819px;
    transform: translateX(-50%);
}

.reward-card {
    position: relative;
    width: 217px;
    min-height: 264px;
    color: #9f1c32;
    text-align: center;
}

.reward-icon-box {
    position: relative;
    width: 217px;
    height: 217px;
    border-radius: 24px;
    background: rgba(197, 45, 69, 0.12);
}

.reward-card img {
    position: absolute;
    left: 9px;
    top: 9px;
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.reward-card.is-coin img {
    left: 56px;
    top: 56px;
    width: 106px;
    height: 106px;
    filter: drop-shadow(0 12px 16px rgba(233, 151, 33, 0.28));
}

.reward-name {
    margin-top: 10px;
    color: #9f1c32;
    font-size: 24px;
    font-weight: 800;
    line-height: 28px;
}

.reward-note {
    color: var(--cp-panel-sub);
    font-size: 19px;
    font-weight: 700;
    line-height: 22px;
}

html[dir='rtl'] .tab span,
html[dir='rtl'] .panel-title,
html[dir='rtl'] .panel-subtitle,
html[dir='rtl'] .copyright,
html[dir='rtl'] .reward-name,
html[dir='rtl'] .reward-note {
    direction: rtl;
}

html[dir='rtl'] .language-switcher {
    direction: ltr;
}

@media (prefers-reduced-motion: reduce) {
    .plaza-carousel-track.is-looping {
        animation: none;
        transform: none;
        will-change: auto;
    }
}
