* { margin: 0; padding: 0; box-sizing: border-box; user-select: none}
body { min-height: 100vh; overflow: hidden; }

/* 祈愿背景（适配你之前的背景图） */
.gacha-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("../images/gacha_bg/mask.png") no-repeat center/cover fixed;
    /* 暗角+柔光，贴合原版色调 */
    filter: brightness(0.9) contrast(1.1) saturate(1.2);
    z-index: -1;
}
.card {
    width: 150px;
    height: 220px;
}

.r-card-back {
    background-image: url("../images/card_back.png");
}

.sr-card-back {
    background-image: url("../images/Neko_card_back.png");
}

.ssr-card-back {
    background-image: url("../images/传说牌背.png");
}

.animate-roll {
    animation-name: flip;
    transform-origin: 50% 0;
    animation-duration: .3s;
    animation-fill-mode: forwards;
}
@keyframes flip {
    from {
        transform: rotateY(0);
    }
    to {
        transform: rotateY(90deg);
    }
}
.card:not(.active) .card-front{
    display: none;
}
.card.active .card-back{
    display: none;
}
.card-level {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);

    width: 60%;
    height: auto;

    background: transparent;
    border: 3px solid #e6c78b;
    border-radius: 4px;
    box-shadow: none;
}
.card-front, .card-back {
    width: 100%;
    height: 100%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.card-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: start;
}

.card-level img {
    width: 100%;
    height: auto;
    display: block;
}

#WishICO {
    position: fixed;
    top: 15px;
    left: 30px;
    width: 50px;
    height: auto;
    z-index: 100;
    opacity: 0.9;
    filter:
            brightness(1.05)
            contrast(1.1)
            drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

body::before {
    content: "祈愿";
    position: fixed;
    top: 25px;
    left: 100px;

    color: #E2DFD5;
    font-size: 18px;
    font-weight: bold;
    font-family: 'HYWenHei', 'Microsoft YaHei', sans-serif;
    z-index: 101;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.wish-footer {
    position: fixed;
    bottom: 20px;
    left: 30px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 100;
}

.wish-footer .footer-btn {

    min-width: 70px;
    height: 28px;
    padding: 0 13px;
    border-radius: 16px;

    background: #EBE4D8;
    color: #363D51;

    font-size: 12px;
    font-weight: 520; /*粗字体调整*/

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wish-footer .footer-btn:hover {
    background: #DEDCC6;
    border-color: #fff;
    color: #fff;
}

.close-Wish {
    background-image: url("../images/gacha_bg/exit.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;

    width: 23px;
    height: 25px;

    border: none;
    padding: 0;
    cursor: pointer;
    unicode-bidi:isolate;

    display: flex;
    align-items: center;
    justify-content: center;

    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.wish-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
    transition: all 0.2s;
}
.wish-btn:active {
    transform: scale(0.98);
}

.gacha-container {
    width: 100%; padding: 20px;
    display: flex; flex-direction: column; align-items: center;
}

#wish-container {
    position: fixed;
    right: 100px;
    bottom: 18px;
    z-index: 10;
    display: flex;
    gap: 18px;
}

.wish-btn {
    background-image: url('../images/button.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;

    width: 240px;
    height: 60px;

    color: #a49a90;
    font-size: 18px;
    font-weight: 500;

    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.wish-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
    transition: all 0.2s;
}
.wish-btn:active {
        background-color: transparent;
        opacity: 0.8;
        transform: scale(0.95);
}

.func-btns {
    position: fixed;
    opacity: 0.9;
    bottom: 20px;
    left: 20px;
    right: auto;
    top: auto;
}



.func-btns {
        display: flex;
        gap: 15px;
}

*:hover {
    cursor: url('../images/AIR.png'), auto;
}

body {
    margin: 0;
    cursor: url('../images/AIR.png'), auto;
    font-family: Arial, Helvetica, sans-serif;
}

.card-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;

    background-color: transparent;
    z-index: 5;

    /* 响应式调整 */
    @media (max-width: 768px) {
        gap: 8px;
        padding: 10px;
    }
}

/* 卡片基础样式 */
.card {
    width: 120px; height: 180px;
    border-radius: 10px; overflow: hidden;
    position: relative; cursor: pointer;
    transform-style: preserve-3d;
    animation: cardSlideIn 0.6s ease-out forwards;
    border: none;
    margin: 0;
}
/* 卡片滑入动画（原版从上方落下） */
@keyframes cardSlideIn {
    0% { transform: translateY(-200px) rotate(10deg); opacity: 0; }
    70% { transform: translateY(20px) rotate(-5deg); opacity: 1; }
    100% { transform: translateY(0) rotate(0); opacity: 1; }
}

/* 卡背+卡面（翻牌核心：backface-visibility） */
.r-card-back, .sr-card-back, .ssr-card-back, .card-front {
    background-size: 100% 100% !important;
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
/* 卡背（原神默认祈愿卡背） */
.ssr-card-back{
    background: url("../images/传说牌背.png") center/cover;
    transform: rotateY(0deg);
}

.sr-card-back{
    background: url("../images/Neko_card_back.png") center/cover;
    transform: rotateY(0deg);
}

.r-card-back {
    background: url("../images/card_back.png") center/cover;
    transform: rotateY(0deg);
}

/* 卡面：默认翻转隐藏 */
.card-front {
    background: #fff center/cover;
    transform: rotateY(180deg);
}

/* 点击翻牌 */
.card.active .card-back { transform: rotateY(180deg); }
.card.active .card-front { transform: rotateY(0deg); }

/* 5星金光 */
.ssr.card {
    border:3px solid #BD6932 !important;
    box-shadow:
            0 0 20px #ffd700,
            0 0 40px #FFF07E,
            inset 0 0 15px #ffd700;
}
    .ssr::before {
        content: "";
        position: absolute;
        width: calc(100% - 6px); /* 减去边框宽度 */
        height: calc(100% - 6px); /* 减去边框宽度 */
        left: 3px; /* 边框宽度的一半 */
        top: 3px; /* 边框宽度的一半 */
        background: radial-gradient(#ffd70033, transparent);
        animation: ssrLight 2s infinite alternate;
        border-radius: 7px; /* 比卡片小一点 */
        z-index: 1;
        pointer-events: none;
    }
@keyframes ssrLight { from { opacity: 0.6; } to { opacity: 1; } }

/* 4星蓝光 */
.sr.card {
    border:3px solid #A256E1 !important;
    box-shadow:
            0 0 15px rgb(212, 135, 249),
            0 0 30px rgb(201, 159, 250);
}

.r.card{
    border:3px solid #19a0ea !important;
    box-shadow:
            0 0 15px rgba(78, 191, 252,0.5),
            0 0 30px rgba(78, 191, 252,0.3),
            0 0 5px rgba(78,191,252,0.3);
}
/* 按钮容器样式（用于居中按钮） */
.btn-container {
    position: fixed;
    bottom: 50px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s;
}

/* 隐藏按钮的类 */
.btn-hidden {
    opacity: 0;
    pointer-events: none;
}

/* 跳过按钮样式 */
.skip-btn {
    position: fixed;
    top: 20px;
    right: 60px;

    /* 无边框无背景 */
    background: none;
    border: none;

    /* 文字样式 */
    color: rgba(226, 223, 213, 0.6);
    font-size: 13px;
    font-weight: 300;
    font-family: 'HYWenHei', 'Microsoft YaHei', sans-serif;

    /* 布局 */
    cursor: pointer;
    z-index: 1000;
    display: none;
    padding: 4px 0;
    letter-spacing: 0.5px;

    /* 过渡效果 */
    transition: all 0.2s ease;
}

/* 实心三角形在文字右边 */
.skip-btn::after {
    content: "▶"; /* 实心三角形 */
    font-size: 11px; /* 比文字稍小 */
    opacity: 0.6;
    display: inline-block;
    margin-left: 5px;
    transition: all 0.2s ease;
}

/* 显示状态 */
.skip-btn.show {
    display: inline-block;
}

/* 悬停效果 */
.skip-btn:hover {
    color: rgba(226, 223, 213, 0.9);
}

.skip-btn:hover::after {
    opacity: 1;
    transform: translateX(3px); /* 三角形向右移动 */
}

/* 点击效果 */
.skip-btn:active {
    color: rgba(226, 223, 213, 1);
}

.skip-btn:active::after {
    transform: translateX(5px); /* 点击时移动更多 */
}

/* 历史记录界面样式 */
.history-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 30, 0.98);
    backdrop-filter: blur(15px);
    z-index: 20;
    display: none; /* 默认隐藏 */
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-container.show {
    display: block;
    opacity: 1;
}

.history-header {
    position: sticky;
    top: 0;
    padding: 20px 40px;
    background: rgba(26, 26, 46, 0.9);
    border-bottom: 1px solid rgba(226, 223, 213, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.history-header h2 {
    color: #E2DFD5;
    font-size: 24px;
    font-weight: 500;
    margin: 0;
}

.history-stats {
    display: flex;
    gap: 25px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.stat-value {
    color: #E2DFD5;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-label {
    color: #B8B5B2;
    font-size: 12px;
    opacity: 0.8;
}

.history-content {
    padding: 30px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 历史记录时间线样式 */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 4px solid transparent;
    transition: background 0.2s;
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.timeline-item.ssr {
    border-left-color: #BD6932;
}

.timeline-item.sr {
    border-left-color: #A256E1;
}

.timeline-item.r {
    border-left-color: #19a0ea;
}

.timeline-time {
    color: #B8B5B2;
    font-size: 13px;
    min-width: 150px;
}

.timeline-card {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-rarity {
    color: #E2DFD5;
    font-size: 16px;
    font-weight: 500;
    min-width: 100px;
}

.timeline-item.ssr .timeline-rarity {
    color: #ffd700;
}

.timeline-item.sr .timeline-rarity {
    color: rgb(212, 135, 249);
}

.timeline-item.r .timeline-rarity {
    color: #4EBFFC;
}

.history-empty {
    text-align: center;
    padding: 80px 20px;
    color: #B8B5B2;
    font-size: 16px;
}

/* 分组标题样式 */
.session-header {
    color: #E2DFD5;
    font-size: 18px;
    font-weight: 500;
    margin: 25px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(226, 223, 213, 0.1);
}

/* 卡片网格视图（备用） */
.history-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.history-card {
    width: 100px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-card-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.history-card-rarity {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    text-align: center;
    padding: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
.history-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
}

.history-stats {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
}

.stat-item {
        min-width: auto;
}

.history-content {
        padding: 20px;
}

.timeline-item {
        flex-wrap: wrap;
        gap: 10px;
}

.timeline-time {
        min-width: 100%;
        order: 1;
    }

.timeline-card {
        order: 2;
        width: 60px;
        height: 85px;
}

.timeline-rarity {
        order: 3;
        min-width: auto;
    }
}
