/* ================= 🎨 极简可视化容器 (无滚动条版) ================= */
.vis-wrapper {
    background: rgba(15, 25, 35, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin: 15px auto;
    
    /* --- 📏 尺寸与布局 --- */
    width: 100%;
    max-width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* 弹性布局让内容居中 */
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: flex-start;

    /* --- 📜 滑动控制 (隐藏滚动条) --- */
    max-height: 60vh; /* 限制高度 */
    overflow-y: scroll; /* 允许滚动 */
    
    /* 隐藏滚动条的核心代码 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Chrome/Safari 隐藏滚动条 */
.vis-wrapper::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.vis-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 12px;
    font-weight: 700;
    color: #889eb1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
    flex-shrink: 0;
}

/* ================= 🐍 Snakes 网格 (强制居中) ================= */
.vis-snake-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    
    /* 居中核心 */
    width: 100%;
    aspect-ratio: 1; /* 保持正方形 */
    margin: 0 auto;  /* 水平居中 */
    
    flex-shrink: 0;
}

/* 通用方块 */
.v-tile {
    width: 100%; height: 100%; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; position: relative;
    background: linear-gradient(145deg, #2c3e50, #1a2630);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.1);
}

/* 🟢 起点 */
.v-tile.v-start { background: #2f4553; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }

/* ✅ 安全路过 */
.v-tile.v-safe { background: #ffffff !important; color: #0f1923; box-shadow: 0 0 10px rgba(255, 255, 255, 0.6); z-index: 2; }

/* ☠️ 致命撞击点 */
.v-tile.v-fatal { background: #ff4d4d !important; color: white; font-size: 16px; box-shadow: 0 0 15px rgba(255, 77, 77, 0.8); z-index: 3; animation: pulse-red 1s infinite; }

/* 🐍 隐藏蛇 */
.v-tile.v-snake-hidden {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 50%; opacity: 0.3;
}

/* 中间镂空 */
.v-tile.v-empty { background: transparent; box-shadow: none; }

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* Crash 样式 */
.vis-crash-box { width: 100%; height: 120px; position: relative; background: radial-gradient(circle at bottom left, rgba(0, 231, 1, 0.05) 0%, transparent 60%); border-radius: 8px; overflow: hidden; border-left: 2px solid rgba(255,255,255,0.1); border-bottom: 2px solid rgba(255,255,255,0.1); flex-shrink: 0; }
.vis-crash-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.vc-val { font-size: 24px; font-weight: 900; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.vc-tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); text-transform: uppercase; font-weight: 700; margin-bottom: 4px; display: inline-block; }

/* 移动端适配 */
@media (max-width: 480px) {
    .vis-wrapper { width: 95%; padding: 15px; max-height: 70vh; }
    .vis-snake-grid { gap: 4px; }
    .v-tile { font-size: 10px; }
}

/* ================= ♠️ Blackjack 可视化样式 ================= */
.vis-bj-table {
    width: 100%;
    background: radial-gradient(circle at 50% 0%, #1a3c2f 0%, #0f1923 100%); /* 迷你绿桌 */
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.v-bj-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.v-bj-label {
    font-size: 11px;
    color: #889eb1;
    font-weight: 700;
    text-transform: uppercase;
}

.v-bj-cards {
    display: flex;
    gap: 4px; /* 牌之间的间距 */
    justify-content: center;
}

/* 迷你扑克牌 */
.v-mini-card {
    width: 30px;
    height: 42px;
    background: white;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    font-family: monospace;
    line-height: 1;
}

.v-mini-card.red { color: #e74c3c; }
.v-mini-card.black { color: #2c3e50; }

.v-val { font-size: 12px; font-weight: 900; }
.v-suit { font-size: 14px; margin-top: -2px; }

.v-bj-divider {
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    font-weight: bold;
    margin: 5px 0;
}

/* 玩家多手牌时的布局 */
.v-bj-hands-wrapper {
    display: flex;
    gap: 15px; /* 多手牌之间的间距 */
    justify-content: center;
    flex-wrap: wrap;
}

/* ... (原有的 Blackjack 样式) ... */

/* 🟢 边注结果样式 */
.v-sb-container {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    width: 100%;
}

.v-sb-badge {
    background: linear-gradient(135deg, #3f2b96 0%, #a8c0ff 100%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

/* ================= 💣 Mines 可视化样式 (新增) ================= */
.vis-mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5x5 网格 */
    gap: 4px;
    width: 100%;
    aspect-ratio: 1; /* 保持正方形 */
    margin: 0 auto;
}

.vm-tile {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: #2f4553; /* 默认深色背景 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    opacity: 0.3; /* 默认未翻开的是暗的 */
}

/* 💎 玩家翻开的钻石 */
.vm-tile.picked-gem {
    background: #00e701;
    box-shadow: 0 0 8px rgba(0, 231, 1, 0.4);
    opacity: 1;
    font-size: 12px;
}

/* 💣 玩家踩到的雷 (导致输掉的那颗) */
.vm-tile.picked-boom {
    background: #ff4d4d;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
    opacity: 1;
    font-size: 14px;
}

/* 👁️ 游戏结束显示的其余雷 (未触发) */
.vm-tile.reveal-mine {
    background: rgba(255, 77, 77, 0.2);
    border: 1px solid rgba(255, 77, 77, 0.5);
    opacity: 0.6;
    font-size: 10px;
}


/* ================= 🎲 Dice 现代高级样式 (Pro Version) ================= */

/* 外层容器 (可选，用于增加卡片质感) */
.vis-wrapper {
    background: #1A212A; /* 深色卡片背景 */
    border: 1px solid #2F3946;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    font-family: 'Inter', sans-serif; /* 建议使用现代字体 */
}

/* 头部 (Win/Loss 标题) */
.vis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #98A7B5;
    margin-bottom: 5px;
}

/* 🛤️ 轨道容器 - 增加凹陷感 */
.vis-dice-track {
    position: relative;
    width: 100%;
    height: 12px; /* 稍微加厚一点 */
    background: #0f141b; /* 比背景更深，制造凹陷 */
    border-radius: 8px;
    margin: 35px 0 15px 0; /* 留足空间给气泡 */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); /* 核心：内阴影制造深度 */
    overflow: visible; /* 允许 marker 溢出 */
}

/* 🟢 获胜区域 (渐变 + 荧光) */
.vd-win-area {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #00E676, #00b35c); /* 渐变色 */
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.4); /* 绿色荧光 */
    transition: all 0.3s ease;
}

/* 📍 结果标记 (白色滑块) */
.vd-marker {
    position: absolute;
    top: -4px; /* 垂直居中修正 */
    width: 6px;
    height: 20px;
    background: #ffffff;
    border-radius: 4px;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5); /* 白色辉光 */
    z-index: 10;
    transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1); /* 顺滑移动动画 */
}

/* 🏷️ 结果数值气泡 (带箭头) */
.vd-result-bubble {
    position: absolute;
    top: -38px; /* 抬高位置 */
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace; /* 数字用等宽字体更帅 */
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    
    
}

/* 🔽 气泡下方的小三角箭头 */
.vd-result-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
}

/* ✅ WIN 状态样式 */
.vd-result-bubble.win {
    background: #00E676;
    color: #0f141b; /* 黑字对比度高 */
    text-shadow: none;
}
.vd-result-bubble.win::after {
    border-color: #00E676 transparent transparent transparent;
}

/* ❌ LOSS 状态样式 */
.vd-result-bubble.loss {
    background: #2F3946; /* 输的时候用深灰色，不要太刺眼的红，显得高级 */
    color: #FF4444;       /* 红色字体点缀 */
    border: 1px solid #FF4444; /* 细红边框 */
}
.vd-result-bubble.loss::after {
    border-color: #FF4444 transparent transparent transparent;
    bottom: -6px; /* 边框修正 */
}
/* 如果想要纯红色块背景，用下面这个覆盖上面的 loss 样式 */
/* .vd-result-bubble.loss { background: #FF4444; color: white; border: none; } */
/* .vd-result-bubble.loss::after { border-color: #FF4444 transparent transparent transparent; } */


/* 底部刻度文字 */
.vd-info-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    color: #556575; /* 次要文字颜色 */
    margin-top: 8px;
    user-select: none;
}



/* ================= 🎱 Keno 可视化样式 (新增) ================= */
.vis-keno-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* 8列 */
    gap: 3px;
    width: 100%;
    aspect-ratio: 1.6; /* 保持 Keno 的 8:5 比例 */
    margin: 0 auto;
}

.vk-tile {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    background: #2f4553; /* 默认深色背景 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: rgba(255,255,255,0.2);
    font-weight: 700;
}

/* 🟣 玩家选中但没中 (Selected) */
.vk-tile.v-selected {
    background: #534a9e; /* 暗紫色 */
    color: white;
}

/* 🔴 系统开出但没选中 (Drawn) */
.vk-tile.v-drawn {
    background: #2f4553;
    position: relative;
}
.vk-tile.v-drawn::after {
    content: '';
    width: 4px; height: 4px;
    background: #ff4d4d; /* 红色小点 */
    border-radius: 50%;
}

/* 🟢 命中！(Hit) */
.vk-tile.v-hit {
    background: #00e701;
    color: #012001;
    box-shadow: 0 0 5px rgba(0, 231, 1, 0.4);
    font-weight: 900;
}

/* ================= 🚀 Limbo 可视化样式 (新增) ================= */
.vis-limbo-content {
    width: 100%;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 背景火箭图标 */
.vl-bg-icon {
    position: absolute;
    font-size: 80px;
    opacity: 0.05;
    transform: rotate(-45deg);
    z-index: 0;
    filter: grayscale(100%);
}

/* 结果大数字 */
.vl-val {
    font-size: 36px;
    font-weight: 900;
    font-family: "Inter", monospace;
    z-index: 1;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* 颜色状态 */
.vl-val.win { color: #00e701; text-shadow: 0 0 20px rgba(0, 231, 1, 0.4); }
.vl-val.loss { color: #ff4d4d; text-shadow: 0 0 20px rgba(255, 77, 77, 0.4); }

/* 目标倍数小字 */
.vl-target {
    font-size: 11px;
    color: #889eb1;
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 10px;
    margin-top: 10px;
    z-index: 1;
    font-weight: 700;
}

/* ================= 🎡 Roulette 可视化样式 (新增) ================= */
.vis-roulette-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
}

/* 结果大徽章 (圆球) */
.vr-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: white;
    border: 3px solid rgba(255,255,255,0.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    margin-bottom: 10px;
}

/* 颜色变体 */
.vr-red { background: #e74c3c; box-shadow: 0 0 10px rgba(231, 76, 60, 0.4); }
.vr-black { background: #2c3e50; box-shadow: 0 0 10px rgba(44, 62, 80, 0.4); }
.vr-green { background: #00e701; color: black; box-shadow: 0 0 10px rgba(0, 231, 1, 0.4); }

/* 信息文字 */
.vr-info-row {
    font-size: 11px;
    color: #889eb1;
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    padding: 4px 10px;
    border-radius: 4px;
}
.vr-highlight { color: #fff; font-weight: 700; }

/* ================= 🐲 Dragon Tower 可视化样式 (新增) ================= */
.vis-tower-grid {
    display: flex;
    flex-direction: column-reverse; /* 塔是从下往上爬，但HTML是从上往下写，所以反转 */
    gap: 3px;
    width: 100%;
    max-width: 180px; /* 限制宽度，保持比例 */
    margin: 10px auto;
    background: rgba(0,0,0,0.2);
    padding: 5px;
    border-radius: 4px;
}

.vt-row {
    display: flex;
    gap: 3px;
    width: 100%;
    height: 12px; /* 每一层的高度 */
}

.vt-block {
    flex: 1;
    background: #2f4553;
    border-radius: 2px;
    opacity: 0.3; /* 默认未走的格子是暗的 */
}

/* 🥚 成功拿到蛋 (路径) */
.vt-block.vt-egg {
    background: #f3ba2f;
    opacity: 1;
    box-shadow: 0 0 5px rgba(243, 186, 47, 0.5);
}

/* 💀 踩到骷髅 (失败) */
.vt-block.vt-skull {
    background: #ff4d4d;
    opacity: 1;
    box-shadow: 0 0 5px rgba(255, 77, 77, 0.5);
}

/* 难度标签 */
.vt-diff-tag {
    font-size: 10px;
    color: #889eb1;
    text-align: center;
    margin-top: 5px;
}