/* game/bac/app.css */

:root {
    --bg-core: #2b0e45;
    --bg-deep: #0f0518;
    --gold: #ffd700;
    --blue: #3498db;
    --red: #e74c3c;
    --green: #2ecc71;
    --chip-size: 42px; 
    --font-main: 'Roboto Mono', monospace;
    --font-serif: 'Playfair Display', serif;
}

body {
    margin: 0;
    background: radial-gradient(circle at 50% 10%, var(--bg-core), var(--bg-deep) 80%);
    color: #fff;
    font-family: var(--font-main);
    height: 100dvh; 
    display: flex; flex-direction: column; overflow: hidden;
    user-select: none; -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* --- 顶部 --- */
.game-header {
    padding: 10px 20px; display: flex; justify-content: space-between; align-items: center;
    background: transparent; flex-shrink: 0; z-index: 10;
}
.brand { font-size: 1.1rem; color: #fff; font-weight: 900; letter-spacing: 1px; font-family: var(--font-serif); }
.wallet-capsule {
    background: rgba(0,0,0,0.4); border: 1px solid var(--gold);
    border-radius: 20px; padding: 4px 12px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}
.value { color: var(--gold); font-weight: 900; font-size: 0.9rem; }

/* --- 牌桌主体 --- */
.table-container {
    flex: 1; display: flex; flex-direction: column; justify-content: space-between;
    padding: 10px 0 20px 0;
    background: transparent;
    position: relative;
}

/* 发牌区 */
.deal-area { 
    display: flex; justify-content: center; align-items: flex-start; 
    height: 150px; position: relative; gap: 20px;
}
.hand-zone { 
    width: 40%; text-align: center; position: relative; 
    transition: transform 0.3s;
}
.hand-zone.winner-highlight { transform: scale(1.05); }

.zone-label { font-size: 0.8rem; font-weight: 900; letter-spacing: 1px; margin-bottom: 5px; }
.player-label { color: var(--blue); text-shadow: 0 0 10px rgba(52, 152, 219, 0.3); }
.banker-label { color: var(--red); text-shadow: 0 0 10px rgba(231, 76, 60, 0.3); }

.vs-center { 
    position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
    font-family: var(--font-serif); font-style: italic; color: #fff; 
    font-weight: 900; opacity: 0.1; font-size: 2rem; z-index: 0;
}

/* 胜者印章 */
.winner-seal {
    position: absolute; top: -15px; right: 10px;
    background: var(--gold); color: #000; font-weight: 900; font-size: 0.7rem;
    padding: 2px 6px; border-radius: 4px; border: 1px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index: 20;
    transform: rotate(15deg) scale(0);
    animation: stampIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes stampIn { to { transform: rotate(15deg) scale(1); } }

.score-badge {
    display: inline-block; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1);
    padding: 1px 10px; border-radius: 10px; margin-bottom: 10px;
    font-size: 0.8rem; min-width: 20px; color: #ddd;
}

/* 卡牌 */
.cards-container.realistic-spread {
    display: flex; justify-content: center; align-items: flex-start;
    height: 100px; overflow: visible; padding-left: 15px;
}
.card {
    width: 64px; height: 96px;
    background: linear-gradient(135deg, #fffcf5 0%, #f0f0f0 100%);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.3);
    position: relative; flex-shrink: 0; margin: 0;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 3px; font-weight: 900; color: #2c3e50; font-family: var(--font-main);
    animation: dealSlowly 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    transform-origin: center bottom; opacity: 0;
}
.card + .card { margin-left: -32px; transform: translateY(-2px); z-index: 1; }
.card + .card + .card { z-index: 2; transform: translateY(-4px); }
.card.red { color: #c0392b; }
.card-val { position: absolute; font-size: 1.1rem; line-height: 1; text-align: center; display: flex; flex-direction: column; gap: 0px; }
.card-val.corner.top-left { top: 3px; left: 3px; }
.card-val.corner.bottom-right { bottom: 3px; right: 3px; transform: rotate(180deg); }
@keyframes dealSlowly { from { transform: translate(0, -200px) rotate(5deg) scale(1.1); opacity: 0; } to { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } }

/* 下注台面 */
.betting-table { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; }
.bet-spot {
    width: 90px; height: 90px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(0,0,0,0.2); cursor: pointer; transition: all 0.1s;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
}
.bet-spot:active { transform: scale(0.95); background: rgba(255,255,255,0.05); }
.blue-spot { border-color: rgba(52, 152, 219, 0.3); }
.red-spot { border-color: rgba(231, 76, 60, 0.3); }
.green-spot { border-color: rgba(46, 204, 113, 0.3); width: 60px; height: 60px; margin-top: 15px; }

.spot-name { font-size: 0.8rem; font-weight: 900; letter-spacing: 1px; }
.odds { font-size: 0.6rem; opacity: 0.6; font-weight: 500; margin-top: 2px; }

.my-chip {
    position: absolute; width: 28px; height: 28px;
    background: var(--gold); color: #000; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 0.6rem; font-weight: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6); border: 2px dashed #fff;
    display: none; z-index: 5;
}

.msg-log.toast {
    text-align: center; height: 20px; color: var(--gold); font-size: 0.8rem; font-weight: 900;
    margin: 5px 0; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* --- 底部控制 (核心优化) --- */
.controls-panel {
    background: rgba(20, 5, 35, 0.95); backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0; 
    padding: 10px 10px calc(20px + env(safe-area-inset-bottom)) 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    min-height: 160px; /* 锁定高度 */
    gap: 10px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s;
}

/* 🔴 关键样式：发牌时只变暗，不隐藏，防止跳动 */
.controls-panel.disabled {
    pointer-events: none; /* 禁止点击 */
    filter: grayscale(0.8); /* 变灰 */
    opacity: 0.7;
}

/* 🔴 路单样式 */
.roadmap-scroll {
    width: 100%; height: 28px;
    display: flex; gap: 5px; overflow-x: auto; 
    align-items: center; justify-content: flex-start;
    padding: 0 10px; box-sizing: border-box;
    /* 隐藏滚动条 */
    scrollbar-width: none; 
}
.roadmap-scroll::-webkit-scrollbar { display: none; }

.bead {
    width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
    font-size: 10px; line-height: 20px; text-align: center; color: #fff; font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    animation: popIn 0.3s;
}
.bead.p { background: var(--blue); border: 1px solid rgba(255,255,255,0.2); }
.bead.b { background: var(--red); border: 1px solid rgba(255,255,255,0.2); }
.bead.t { background: var(--green); border: 1px solid rgba(255,255,255,0.2); }

@keyframes popIn { from {transform: scale(0);} to {transform: scale(1);} }

/* 筹码架 */
.chips-rack { display: flex; justify-content: center; gap: 12px; width: 100%; padding: 5px 0; }
.chip {
    position: relative; width: var(--chip-size); height: var(--chip-size);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 11px; color: #222; text-shadow: 0 1px 0 rgba(255,255,255,0.8);
    cursor: pointer; transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none; background: none; z-index: 2;
}
.chip.selected { transform: translateY(-8px) scale(1.15); z-index: 10; }
.chip::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; z-index: -2; background: repeating-conic-gradient(var(--chip-main) 0deg 36deg, var(--chip-spot) 36deg 45deg); box-shadow: inset 0 2px 3px rgba(255,255,255,0.3), inset 0 -2px 3px rgba(0,0,0,0.4), 0 3px 5px rgba(0,0,0,0.4); }
.chip::after { content: ''; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px; border-radius: 50%; z-index: -1; background: #f4f4f4; border: 1px solid rgba(0,0,0,0.1); box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 2px var(--chip-main) inset; }

.chip-10 { --chip-main: #2980b9; --chip-spot: #ecf0f1; }
.chip-50 { --chip-main: #27ae60; --chip-spot: #f1c40f; }
.chip-100 { --chip-main: #2c3e50; --chip-spot: #95a5a6; }
.chip-100::before { background: repeating-conic-gradient(var(--chip-main) 0deg 22.5deg, var(--chip-spot) 22.5deg 30deg); }
.chip-500 { --chip-main: #8e44ad; --chip-spot: #f1c40f; }
.chip-500::after { background: #fcf3cf; }
.chip-all { --chip-main: #111; --chip-spot: #f39c12; color: #c0392b; font-size: 10px; }
.chip-all::before { background: repeating-conic-gradient(var(--chip-main) 0deg 60deg, var(--chip-spot) 60deg 90deg); }
.chip-all::after { background: #f9e79f; }

.btn-main {
    width: 80%; max-width: 250px; height: 44px;
    background: linear-gradient(135deg, #b8860b 0%, #ffd700 100%);
    border: none; border-radius: 22px; color: #000; font-size: 1rem; font-weight: 900; letter-spacing: 2px;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3); transition: all 0.2s; cursor: pointer;
}
.btn-main:active { transform: scale(0.98); background: #ffaa00; }
.btn-main:disabled { background: #444; color: #888; box-shadow: none; cursor: not-allowed; }

/* 弹窗保持不变 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-box { width: 80%; max-width: 320px; background: linear-gradient(145deg, #1a0b2e, #0f0518); border: 1px solid var(--gold); border-radius: 12px; padding: 30px 20px; text-align: center; box-shadow: 0 0 30px rgba(138, 43, 226, 0.2); transform: scale(0.9); transition: transform 0.3s; }
.modal-overlay.active .modal-box { transform: scale(1); }
.modal-title { font-size: 1.5rem; color: #e74c3c; font-weight: 900; margin-bottom: 10px; font-family: var(--font-main); letter-spacing: 2px; }
.modal-desc { color: #aaa; font-size: 0.9rem; margin-bottom: 25px; line-height: 1.6; }
.btn-mining { display: block; width: 100%; padding: 15px 0; background: linear-gradient(to right, #2ecc71, #27ae60); color: #fff; font-weight: 900; text-decoration: none; border-radius: 30px; letter-spacing: 2px; box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3); transition: transform 0.2s; }

/* --- 华丽下注区 (Royal Betting Spots) - 低奢磨砂版 --- */
.betting-table {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 10px;
}

.bet-spot {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    
    /* 核心改变：哑光古铜色边框，去掉发光 */
    border: 2px solid #8a6f3e; /* 暗黄铜色 */
    
    /* 核心改变：只保留极深的内部阴影，制造凹陷感，不发光 */
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.9);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease-out;
    position: relative;
}

/* 点击时的反馈：更深的下陷感 */
.bet-spot:active {
    transform: scale(0.97);
    box-shadow: inset 0 8px 25px rgba(0,0,0,1);
    border-color: #5a4f3e; /* 边框变暗 */
}

/* 各区域专属配色 (深沉、不刺眼) */
/* 闲 - 深海蓝 */
.blue-spot {
    background: linear-gradient(145deg, #1e2b38, #0d1218);
}
/* 庄 - 勃艮第红 */
.red-spot {
    background: linear-gradient(145deg, #381e1e, #180d0d);
}
/* 和 - 墨绿 (稍小) */
.green-spot {
    width: 70px;
    height: 70px;
    margin-top: 13px;
    background: linear-gradient(145deg, #1e3825, #0d1810);
}

/* 文字样式优化 (使用哑光金) */
.spot-name {
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #c4a747; /* 哑光金字 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
.odds {
    font-size: 0.65rem;
    opacity: 0.6;
    font-weight: 700;
    margin-top: 3px;
    color: #a48737; /* 更暗的金色赔率 */
}

/* --- 桌上精美筹码 (Exquisite Placed Chips) - 低奢磨砂版 --- */
.my-chip {
    position: absolute;
    width: 42px; /* 稍微精巧一点 */
    height: 42px;
    border-radius: 50%;
    
    /* 核心升级：磨砂黑金陶瓷质感 */
    background: linear-gradient(to bottom, #2a2218, #1a1208); /* 深棕黑色基底 */
    border: 2px solid #c4a747; /* 哑光暗金边框 */
    
    /* 柔和、贴地的投影，营造重量感 */
    box-shadow: 0 3px 6px rgba(0,0,0,0.7);

    color: #e4c767; /* 哑光金文字 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 900;
    font-family: var(--font-main);
    letter-spacing: 0.5px;
    z-index: 10;
    
    /* 动画改为更有重量感的落下 */
    animation: heavyDrop 0.25s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* 筹码内部装饰圈 */
/* game/bac/app.css - 替换原有的 .my-chip 样式 */

/* --- 桌上精美筹码 (Placed Chips) - 低饱和陶瓷磨砂版 --- */
.my-chip {
    position: absolute;
    /* 尺寸适中，能在圈内随意摆放 */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* 字体：清晰的深色哑光字 */
    font-size: 0.7rem;
    font-weight: 900;
    font-family: var(--font-main);
    color: #2c2c2c;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    
    z-index: 10;
    
    /* 默认居中定位 (稍后 JS 会修改这里的 top/left 实现随机) */
    top: 50%;
    left: 50%;
    /* 关键：使用 translate 居中自身，方便后续微调偏移 */
    transform: translate(-50%, -50%);
    transition: all 0.3s ease-out; /* 让位置变化有动效 */

    /* 整体柔和投影 */
    box-shadow: 0 3px 5px rgba(0,0,0,0.3);
}

/* 🎨 纹理层1: 外圈色块 (Edge Spots) - 陶土红风格 */
.my-chip::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    z-index: -2;
    
    /* 低饱和度陶土配色 */
    --placed-base: #8c5e4a; /* 陶土基底 */
    --placed-spot: #5c3e32; /* 深岩斑点 */

    background: repeating-conic-gradient(
        from 20deg, /* 稍微旋转一点角度，看起来更随意 */
        var(--placed-base) 0deg 45deg,
        var(--placed-spot) 45deg 60deg
    );

    /* 磨砂内阴影 */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

/* 🎨 纹理层2: 中央内嵌盘 (Inner Inlay) - 哑光米灰 */
.my-chip::after {
    content: '';
    position: absolute;
    /* 内圈稍微大一点，方便显示金额文字 */
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border-radius: 50%;
    z-index: -1;
    
    /* 哑光米灰色内盘背景 */
    background: linear-gradient(145deg, #d9d9d9, #bfbfbf);
    border: 1px solid rgba(0,0,0,0.1);
    
    /* 内盘柔和光影 */
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.5);
}

/* 绿色和局区域稍微小一点适配 */
.green-spot .my-chip {
    width: 36px;
    height: 36px;
    font-size: 0.65rem;
}
.green-spot .my-chip::after { top: 4px; left: 4px; right: 4px; bottom: 4px; }

/* 移除之前的落下动画，因为我们要用 JS 控制位置移动 */
/* @keyframes heavyDrop ... (已移除) */

