﻿:root {
    /* Define color variables */
    --primary-color: #2bacce;
    --text-black: #565656;
    --text-white: #ffffff;
    --darker-text-black: #3b425c;
}

/* Define Custom Font */
@font-face {
    font-family: 'Wenhei';
    src: url('./zh-cn.ttf');
}

/* global styles */
* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    font-family: Wenhei, sans-serif;
}

/* reset button styles */
button {
    background: none;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
    font-family: Wenhei, sans-serif;
}

/* prevent imgs from dragging away */
img {
    pointer-events: none;
}

.bigger-text {
    font-size: 2.4vmin;
}

.medium-text {
    font-size: 2vmin;
    color: var(--text-white);
}

.smaller-text {
    font-size: 1.75vmin;
}

.black-shadow {
    text-shadow:
        -0.1vmin -0.1vmin 0 rgba(0, 0, 0, 0.25),
        0.1vmin -0.1vmin 0 rgba(0, 0, 0, 0.25),
        -0.1vmin 0.1vmin 0 rgba(0, 0, 0, 0.25),
        0.1vmin 0.1vmin 0 rgba(0, 0, 0, 0.25);
}

#background-video,
#background-image {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.bg-dark {
    background-color: rgba(14, 52, 91, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.poster {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    z-index: 1;
    aspect-ratio: 1.92 / 1;
    height: 56.25vmin;
    background: url("./resources/UI_GachaShowPanel_Bg_Ice.png") no-repeat center / 100% 100%;
    padding: 7.5vmin 4.3vmin 2.6vmin 4.3vmin;
}

.main-img-mask {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    /* mask */
    overflow: hidden;
    border-radius: 1vmin;
    mask-image: linear-gradient(to right, transparent 0%, black 25%, black 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 25%, black 75%, transparent 100%);
}

.main-img {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 100%;
    transform: translate(-50%, -45%) scale(1.8);
}

.side-img {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 3;
    height: 100%;
}

.banner-sign {
    position: absolute;
    /* offset */
    top: -0.15vmin;
    left: -0.5vmin;
    /* layer 2 z-index 1(top of layer 2) */
    z-index: 4;
    color: white;
    background-color: var(--primary-color);
    padding: 0.5vmin 1.5vmin 0.5vmin 1.2vmin;
    border-radius: 2vmin 0 4vmin 2vmin;
}

/* 左侧整体 */
.poster-text-left {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    /* 纵向分布 */
    justify-content: space-between;
    /* 左侧对齐 */
    align-items: flex-start;
    gap: 2.3vmin;
    /* 纵向高度占满 */
    height: 100%;
    width: fit-content;
    color: var(--text-black);
    /* 文本描边 */
    text-shadow:
        -0.1vmin -0.1vmin 0 rgba(255, 255, 255, 0.8),
        0.1vmin -0.1vmin 0 rgba(255, 255, 255, 0.8),
        -0.1vmin 0.1vmin 0 rgba(255, 255, 255, 0.8),
        0.1vmin 0.1vmin 0 rgba(255, 255, 255, 0.8);
}

/* 左侧part1 */
.gacha-name {
    font-size: 6.3vmin;
    line-height: 6.3vmin;
}

.colored-text {
    color: var(--primary-color);
}

/* 竖线 */
.describe-content::before {
    content: "";
    position: absolute;
    left: -3vmin;
    top: -0.1vmin;
    bottom: -0.1vmin;
    width: 0.65vmin;
    border-radius: 0.1vmin;
    background-color: var(--text-black);
}

.describe-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75vmin;
    justify-content: flex-start;
    align-items: flex-start;
}

/* 左侧part2 */
.describe {
    display: flex;
    flex-direction: column;
    position: relative;
    left: -3vmin;
    height: 100%;
    padding: 1.5vmin 0 0 3vmin;
    margin-left: -0.4vmin;
}

/* above and below line */
.describe::before {
    content: "";
    position: absolute;
    left: 3vmin;
    top: 0;
    width: 32.2vmin;
    border-top: 0.25vmin dashed rgba(154, 125, 44, 0.3);
}

.describe::after {
    content: "";
    position: absolute;
    left: 3vmin;
    bottom: 1.5vmin;
    width: 29vmin;
    border-bottom: 0.25vmin dashed rgba(154, 125, 44, 0.3);
}

.colored-background {
    display: flex;
    align-items: center;
    gap: 0.7vmin;
    padding: 0.25vmin 0.7vmin;
    font-size: 2vmin;
    text-shadow: none;
    background-color: var(--primary-color);
    opacity: 0.9;
}

#star-icon {
    height: 1.9vmin;
    width: 1.9vmin;
}

.character-label {
    position: absolute;
    top: 75%;
    left: 51.2%;
    z-index: 5;
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas: 'icon name  up'
        'name-bg stars .'
        '. sign  .';
    transform: translate(0, -46%);
}

#element-icon {
    grid-area: icon;
    z-index: 7;
    height: 6vmin;
    width: 6vmin;
    margin: 0.2vmin 0.5vmin 0 0;
    filter: drop-shadow(0 0 1.5vmin black);
}

.character-name {
    grid-area: name;
    font-size: 5.2vmin;
    color: var(--text-white);
    margin: 0 0.4vmin;
    z-index: 7;
    text-shadow:
        -0.12vmin -0.12vmin 0 rgba(0, 0, 0, 0.3),
        0.12vmin -0.12vmin 0 rgba(0, 0, 0, 0.3),
        -0.12vmin 0.12vmin 0 rgba(0, 0, 0, 0.3),
        0.12vmin 0.12vmin 0 rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 1.5vmin grey);
}

.up {
    grid-area: up;
}

.UP::before {
    content: "UP!";
    z-index: 7;
    color: rgb(255, 255, 90);
    filter: drop-shadow(0 0 1vmin rgb(255, 203, 90));
    text-shadow:
        -0.12vmin -0.12vmin 0 rgba(176, 93, 17, 0.7),
        0.12vmin -0.12vmin 0 rgba(176, 93, 17, 0.7),
        -0.12vmin 0.12vmin 0 rgba(176, 93, 17, 0.7),
        0.12vmin 0.12vmin 0 rgba(176, 93, 17, 0.7);
}

.name-bg {
    grid-area: name-bg;
    position: relative;
    margin: 3.5vmin -2vmin -0.3vmin 3vmin;
    /* adjust bg position */
    grid-row: 1 / 3;
    grid-column: 1 / 3;
    z-index: 6;
    /* in grid */
    background-color: rgba(0, 0, 0, 0.7);
}

.five-stars {
    grid-area: stars;
    grid-column: 2 / 4;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    z-index: 7;
}

.star-icon {
    height: 2.2vmin;
}

.character-sign {
    /* with smaller text-size */
    /* adjust position */
    position: relative;
    left: -0.6vmin;
    top: 0.5vmin;
    /* set to correct cell */
    grid-area: sign;
    /* center the content (span text) */
    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 7;
    grid-column: 2 / 4;
    padding: 0.1vmin 0.9vmin;
    /* variable width depends on the text */
    width: fit-content;
    color: #d3bc8e;
}

/* sian text in span to fix layer problem */
.character-sign span {
    position: relative;
    z-index: 7;
}

/* use ::before as bg */
.character-sign::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 6;
    /* in grid */
    background-color: #38425c;
    border: #343e51 solid 0.15vmin;
}

.ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
    padding: 2.25vmin 5.62vmin 2.27vmin 5.62vmin;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ui-top,
.ui-bottom {
    pointer-events: auto;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ui-top-left {
    position: relative;
    left: -1.65vmin;
    top: -0.65vmin;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 3.5vmin;
    color: #f6f2ee;
    text-shadow:
        -0.1vmin -0.1vmin 0 rgba(0, 0, 0, 0.15),
        0.1vmin -0.1vmin 0 rgba(0, 0, 0, 0.15),
        -0.1vmin 0.1vmin 0 rgba(0, 0, 0, 0.15),
        0.1vmin 0.1vmin 0 rgba(0, 0, 0, 0.15);
}

#gacha-icon {
    height: 4.8vmin;
    width: 4.8vmin;
}

.ui-top-center {
    position: fixed;
    left: 50%;
    transform: translate(-50%);
    z-index: 7;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1.63vmin;
}

.gacha-tab {
    position: relative;
    /* for img positioning */
    width: 14.56vmin;
    height: 6.44vmin;
    background: url("./resources/UI_Gacha_Tab_Uncheck.png") center / 100% 100% no-repeat;
    transition: background 0.3s ease, transform 0.1s ease;
}

.gacha-tab:active {
    background: url("./resources/UI_Gacha_Tab_Check.png") center / 100% 100% no-repeat;
    transform: scale(1);
}

.gacha-tab:hover {
    transform: scale(1.05);
}

.gacha-tab img {
    position: absolute;
    width: 100%;
    bottom: -1.5vmin;
    transform: scale(0.95);
}

.ui-top-right {
    position: relative;
    top: 0.1vmin;
    right: -1.05vmin;
    z-index: 9;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 2.5vmin;
}

#gacha-close-icon {
    position: relative;
    right: -0.625vmin;
    top: -0.9vmin;
    height: 5vmin;
    width: 5vmin;
    background: url("./resources/popimage_close_default.png") no-repeat center / 100% 100%;
    filter: drop-shadow(rgba(0, 0, 0, 0.5) 0 0 0.2vmin);
    border-radius: 200vmin;
    /* overlarge to get max radius */
    outline: 0 solid transparent;
    outline-offset: -0.4vmin;
    filter: none;
    transition: all 0.1s ease;
}

#gacha-close-icon:hover {
    outline: 0.4vmin solid rgba(255, 255, 255, 0.8);
    outline-offset: -0.5vmin;
}

#gacha-close-icon:active {
    outline: 0.4vmin solid rgba(190, 177, 130, 0.8);
    outline-offset: -0.5vmin;
    filter: invert(30%) brightness(160%);
}

.intertwined-fate,
.primogem {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 3.1vmin;
    width: fit-content;
    padding: 0.2vmin 0.3vmin 0.2vmin 0.4vmin;
    background: rgba(0, 0, 0, 0.3);
    outline: rgba(255, 255, 255, 0.1) 0.2vmin solid;
    border-radius: 200vmin;
    /* overlarge to get max radius */
}

#intertwined-fate-icon,
#primogem-icon,
#add-primogem-button {
    height: 100%;
}

#intertwined-fate-count,
#primogem-count {
    margin: 0 1.4vmin;
}

#add-primogem-button {
    margin-left: 0.7vmin;
    background: url("./resources/UI_Icon_Add.png") no-repeat center / 95% 95%;
    aspect-ratio: 1 / 1;
    transition: transform 0.2s ease, opacity 0.1s ease;
}

#add-primogem-button:hover {
    transform: scale(1.1);
}

#add-primogem-button:active {
    transform: scale(1.1);
    opacity: 0.5;
}

.ui-center {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 2.2vmin -1.5vmin 0 -1.5vmin;
}

#wish-to-left,
#wish-to-right {
    pointer-events: auto;
    background: url("./resources/UI_BtnIcon_Arrow.png") no-repeat center / 100% 100%;
    height: 3vmin;
    width: 3.8vmin;
    transition: opacity 0.2s ease;
}

#wish-to-left:active,
#wish-to-right:active {
    opacity: 0.3;
}

#wish-to-left {
    transform: rotate(-90deg);
}

#wish-to-right {
    transform: rotate(90deg);
}

.ui-bottom {
    align-items: flex-end;
}

.ui-bottom-left {
    display: flex;
    flex-direction: column;
    position: relative;
    bottom: 0.7vmin;
    gap: 1vmin;
}

.gacha-money-amount {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 3.1vmin;
    margin-left: -0.3vmin;
    width: fit-content;
}

.starlitter,
.stardust {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7vmin;
    height: 3.3vmin;
    width: fit-content;
}

#stardust-icon,
#starlitter-icon {
    height: 100%;
    width: 100%;
}

.gacha-menu-btns {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5vmin;
    filter: drop-shadow(0 0 0.3vmin rgba(0, 0, 0, 0.25));
}

.gacha-menu-btn {
    width: 14.5vmin;
    height: 3.6vmin;
    font-size: 1.8vmin;
    color: var(--darker-text-black);
    background-color: #e3e0d5;
    border-radius: 200vmin;
    /* overbig value to make half-circle corner */
    outline: 0 solid transparent;
    transition: all 0.1s ease;
}

.gacha-menu-btn:hover {
    outline: 0.25vmin solid var(--text-white);
    filter: drop-shadow(0 0 0.2vmin rgba(255, 255, 255, 0.8));
}

.gacha-menu-btn:active {
    outline: 0.25vmin solid #97a1aa;
    outline-offset: -0.2vmin;
    background-color: #d6d3c2;
    color: var(--text-white);
}

.ui-bottom-right {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 1.9vmin;
    margin-right: -1.5vmin;
}

.ui-bottom-right img {
    height: 2.6vmin;
    margin-right: 0.3vmin;
}

.wish-btn-outline {
    background: url("./resources/UI_Button_Gacha_1_Outline.png") no-repeat center / 100% 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 29.4vmin;
    height: 7.3vmin;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

.wish-btn-outline:hover {
    opacity: 1;
    transform: scale(1);
}

#wish-1,
#wish-10 {
    position: relative;
    width: 29.4vmin;
    height: 7.3vmin;
    color: #a89072;
    background: url("./resources/UI_Button_Gacha_1.png") no-repeat center / 100% 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    filter: none;
    opacity: 1;
    transition: all 0.2s ease;
}

#wish-1:active,
#wish-10:active {
    opacity: 0.8;
    background: url("./resources/UI_Button_Gacha_1_active.png") no-repeat center / 100% 100%;
    filter: brightness(140%);
}

.wish-btn-cost {
    display: flex;
    flex-direction: row;
    align-items: center;
}

#uid {
    z-index: 999;
    position: fixed;
    bottom: 0.2vmin;
    right: 4.9vmin;
    color: var(--text-white);
}

/* 竖屏强制横屏：旋转视图 + 尺寸适配 */
@media screen and (orientation: portrait) {
    body {
        /* 1. 旋转画布 */
        transform-origin: top left;
        transform: rotate(90deg) translateY(-100%);
        
        /* 2. 强制交换尺寸：宽=设备高，高=设备宽 */
        width: 100vh;
        height: 100vw;
        
        /* 3. 定位修复 */
        position: fixed;
        top: 0;
        left: 0;
        overflow: hidden;
        
        /* 可选：解决某些浏览器在旋转后的抗锯齿问题 */
        -webkit-backface-visibility: hidden;
    }
}