/* ==================== 诸天祭坛 - 入口按钮 ==================== */
.gacha-entry-btn {
    position: fixed; bottom: 20px; left: 65%; z-index: 100;
    cursor: pointer; transition: transform 0.3s;
    text-align: center;
}
.gacha-entry-btn:hover { transform: scale(1.15); }
.gacha-entry-icon {
    width: 50px; height: 50px;
    background: rgba(30,10,50,0.85); border: 2px solid rgba(200,120,255,0.6);
    border-radius: 10px; display: flex; justify-content: center; align-items: center;
    font-size: 28px; box-shadow: 0 0 12px rgba(200,120,255,0.3);
}
.gacha-entry-label {
    color: #c878ff; font-size: 11px; margin-top: 2px;
    text-shadow: 0 0 6px rgba(200,120,255,0.5);
    font-weight: bold;
}

/* ==================== 弹窗遮罩 + 窗口 ==================== */
.gacha-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 600;
    display: flex; justify-content: center; align-items: center;
}
.gacha-window {
    width: 980px; max-width: 96vw;
    background: radial-gradient(ellipse at center, #0a0618 0%, #000 100%);
    border: 2px solid rgba(200,120,255,0.3);
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(100,50,180,0.3), inset 0 0 80px rgba(50,20,100,0.15);
    display: flex; flex-direction: column; overflow: hidden;
    max-height: 95vh;
}
.gacha-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px;
    background: linear-gradient(90deg, rgba(80,30,130,0.4), rgba(30,10,60,0.2), rgba(80,30,130,0.4));
    border-bottom: 1px solid rgba(200,120,255,0.2);
}
.gacha-title {
    font-size: 20px; font-weight: bold; color: #e0c0ff;
    text-shadow: 0 0 15px rgba(200,120,255,0.6);
}
.gacha-close {
    font-size: 28px; color: #888; cursor: pointer; line-height: 1;
    transition: color 0.2s;
}
.gacha-close:hover { color: #ff6666; }
.gacha-subtitle {
    text-align: center; font-size: 13px; color: #7a6a9a; padding: 8px 0 2px;
}
.gacha-vouchers-bar {
    text-align: center; font-size: 14px; color: #999; padding: 0 0 8px;
}

/* ==================== 规则说明面板 ==================== */
.gacha-rules {
    margin: 0 20px 6px;
    border: 1px solid rgba(200,120,255,0.15);
    border-radius: 8px;
    background: rgba(20,10,40,0.4);
    overflow: hidden;
}
.gacha-rules-toggle {
    padding: 7px 14px;
    font-size: 13px; color: #9a7acc; cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}
.gacha-rules-toggle:hover { color: #c8a0ff; }
.gacha-rules-body {
    padding: 0 14px 10px;
}
.gacha-rule-row {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 0;
}
.gacha-rule-tag {
    display: inline-block;
    padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}
.rule-profit { background: rgba(0,200,120,0.15); color: #00cc78; border: 1px solid rgba(0,200,120,0.3); }
.rule-loss  { background: rgba(255,100,50,0.12); color: #cc7744; border: 1px solid rgba(255,100,50,0.25); }
.rule-god   { background: rgba(255,170,0,0.15); color: #ffaa00; border: 1px solid rgba(255,170,0,0.3); }
.gacha-rule-text {
    font-size: 12px; color: #8a7a9a; line-height: 1.5;
}
.gacha-rule-text b { color: #bbaacc; }

/* ==================== 卡片舞台 ==================== */
.gacha-stage {
    flex: 1; display: flex; justify-content: center; align-items: center;
    perspective: 2500px; padding: 10px 20px; min-height: 310px;
}
.gacha-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
}

/* ==================== 3D 卡片结构 ==================== */
.gacha-card {
    width: 155px; height: 230px; position: relative;
    transform: translateY(100vh); opacity: 0;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s;
}
.gacha-card.in-place {
    transform: translateY(0); opacity: 1;
}
.gacha-card-inner {
    width: 100%; height: 100%; position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.gacha-card.is-flipped .gacha-card-inner {
    transform: rotateY(180deg);
}
.gacha-card-face {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.8);
}

/* ==================== 普通卡背（青色单环符文） ==================== */
.gacha-card-back.normal-back {
    background: radial-gradient(circle at center, #0a1a2a 0%, #030808 100%);
    border: 2px solid rgba(0,229,255,0.4);
    display: flex; align-items: center; justify-content: center;
}
.normal-back .back-ring {
    position: absolute; width: 110px; height: 110px;
    border: 1.5px dashed rgba(0,229,255,0.35); border-radius: 50%;
    animation: gacha-spin-cw 18s linear infinite;
}
.normal-back .back-core {
    width: 60px; height: 60px;
    background: rgba(0,229,255,0.1);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border: 1px solid rgba(0,229,255,0.5);
    animation: gacha-pulse 3s infinite ease-in-out;
}

/* ==================== 至尊卡背（紫金曼陀罗对冲旋转） ==================== */
.gacha-card-back.supreme-back {
    background: radial-gradient(circle at center, #1a0830 0%, #06010e 100%);
    border: 2.5px solid rgba(255,170,0,0.5);
    display: flex; align-items: center; justify-content: center;
}
.supreme-back .back-outer {
    position: absolute; width: 140px; height: 140px;
    border: 2px dotted rgba(255,170,0,0.25); border-radius: 50%;
    animation: gacha-spin-cw 12s linear infinite;
}
.supreme-back .back-mid {
    position: absolute; width: 95px; height: 95px;
    border: 1.5px double rgba(255,170,0,0.4);
    clip-path: polygon(50% 0%, 83% 12%, 100% 43%, 94% 78%, 68% 100%, 32% 100%, 6% 78%, 0% 43%, 17% 12%);
    animation: gacha-spin-ccw 7s linear infinite;
    opacity: 0.7;
}
.supreme-back .back-inner {
    position: absolute; width: 60px; height: 60px;
    border: 1px solid rgba(200,120,255,0.3); border-radius: 50%;
    animation: gacha-spin-cw 5s linear infinite;
}
.supreme-back .back-core {
    width: 35px; height: 35px;
    background: #fff;
    box-shadow: 0 0 25px rgba(255,170,0,0.8);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: gacha-surge 1.5s infinite alternate ease-in-out;
}

/* ==================== 卡面（正面） ==================== */
.gacha-card-front {
    background: linear-gradient(180deg, #0c0c18 0%, #060610 100%);
    transform: rotateY(180deg);
    border: 1px solid #2a2a3a;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px;
}
.gacha-card-front.rare-legendary {
    border: 2.5px solid #ff8c00;
    box-shadow: 0 0 35px rgba(255,140,0,0.35), inset 0 0 20px rgba(255,140,0,0.08);
}
.gacha-card-front.rare-mythic {
    border: 2.5px solid #ffaa00;
    box-shadow: 0 0 40px rgba(255,170,0,0.5), inset 0 0 25px rgba(255,170,0,0.1);
    animation: gacha-mythic-glow 2s infinite alternate ease-in-out;
}
.gacha-card-stone-img {
    width: 80px; height: 80px; object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
    margin-bottom: 12px;
}
.gacha-card-level {
    font-size: 22px; font-weight: bold; color: #ccc;
    text-shadow: 0 0 6px rgba(255,255,255,0.2);
}
.gacha-card-value {
    font-size: 11px; color: #666; margin-top: 4px;
}

/* 高等级名字流光 */
.gacha-name-legendary {
    background: linear-gradient(90deg, #ff8c00, #ffcc00, #ff8c00);
    background-size: 200% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gacha-text-shine 3s linear infinite;
}
/* 18级全彩虹渐变 */
.gacha-name-mythic {
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    background-size: 300% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gacha-text-shine 2.5s linear infinite;
    font-weight: 900;
}

/* ==================== 底部按钮区 ==================== */
.gacha-footer {
    display: flex; justify-content: center; gap: 40px;
    padding: 16px 20px 18px;
    background: linear-gradient(180deg, transparent, rgba(30,10,60,0.3));
}
.gacha-btn {
    background: #111; border-radius: 8px; cursor: pointer;
    padding: 14px 36px; text-align: center;
    transition: all 0.3s; display: flex; flex-direction: column; gap: 4px;
    min-width: 180px;
}
.gacha-btn:active { transform: scale(0.96); }
.gacha-btn-title { font-size: 18px; font-weight: bold; display: block; }
.gacha-btn-cost { font-size: 14px; display: block; }
.gacha-btn-hint { font-size: 11px; display: block; opacity: 0.7; }

/* 普通抽 - 青蓝色 */
.gacha-btn-normal {
    border: 2px solid rgba(0,180,220,0.5);
    box-shadow: 0 0 15px rgba(0,180,220,0.2);
}
.gacha-btn-normal .gacha-btn-title { color: #00e5ff; }
.gacha-btn-normal .gacha-btn-cost { color: #5ab8cc; }
.gacha-btn-normal .gacha-btn-hint { color: #3a8a9a; }
.gacha-btn-normal:hover {
    border-color: #00e5ff;
    box-shadow: 0 0 30px rgba(0,180,220,0.4);
}

/* 至尊抽 - 紫金色 */
.gacha-btn-supreme {
    border: 2px solid rgba(255,170,0,0.5);
    box-shadow: 0 0 15px rgba(255,170,0,0.2);
}
.gacha-btn-supreme .gacha-btn-title { color: #ffaa00; }
.gacha-btn-supreme .gacha-btn-cost { color: #cc8800; }
.gacha-btn-supreme .gacha-btn-hint { color: #996600; }
.gacha-btn-supreme:hover {
    border-color: #ffcc00;
    box-shadow: 0 0 30px rgba(255,170,0,0.5);
}

/* ==================== 粒子火星容器 ==================== */
.gacha-particles {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden;
    border-radius: 12px; z-index: 10;
}
.gacha-particle {
    position: absolute; border-radius: 50%;
    animation: gacha-particle-fly 0.8s ease-out forwards;
}

/* ==================== 动画关键帧 ==================== */
@keyframes gacha-spin-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes gacha-spin-ccw {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}
@keyframes gacha-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.05); }
}
@keyframes gacha-surge {
    from { transform: scale(0.8); }
    to { transform: scale(1.15); }
}
@keyframes gacha-text-shine {
    to { background-position: 200% center; }
}
@keyframes gacha-mythic-glow {
    from { box-shadow: 0 0 30px rgba(255,170,0,0.4), inset 0 0 20px rgba(255,170,0,0.08); }
    to { box-shadow: 0 0 50px rgba(255,100,200,0.6), inset 0 0 30px rgba(255,100,200,0.12); }
}
@keyframes gacha-particle-fly {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0.3); }
}

/* ==================== 响应式 ==================== */
@media (max-width: 1050px) {
    .gacha-card { width: 130px; height: 195px; }
    .gacha-grid { gap: 10px; }
    .gacha-card-stone-img { width: 60px; height: 60px; }
    .gacha-card-level { font-size: 18px; }
}
@media (max-width: 800px) {
    .gacha-card { width: 110px; height: 165px; }
    .gacha-grid { gap: 8px; }
    .gacha-card-stone-img { width: 50px; height: 50px; }
    .gacha-card-level { font-size: 15px; }
    .gacha-btn { min-width: 140px; padding: 10px 24px; }
}
