/* style.css - ENTP 紫金版 (修复底部遮挡) */

:root {
    /* 🟣 ENTP 核心色盘 */
    --table-purple-light: #4a2c66; /* 中心高光紫 */
    --table-purple-dark: #180d24;  /* 边缘深邃紫 */
    
    --gold: #f1c40f;
    --gold-dim: #b7950b;
    --text-light: #ecf0f1;
    
    /* 底部安全区变量 */
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

body {
    margin: 0;
    background-color: #0d0614; /* 极暗紫背景 */
    font-family: 'Roboto', sans-serif;
    overflow: hidden; /* 禁止页面滚动 */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: var(--text-light);
}

/* 🎰 整体容器 */
.casino-table {
    max-width: 600px;
    margin: 0 auto;
    
    /* 🛠️ 核心修复：使用动态视口高度，防止被地址栏盖住 */
    height: 100vh; 
    height: 100dvh; 
    
    display: flex;
    flex-direction: column;
    
    /* 🟣 背景：神秘的紫色径向渐变 */
    background: radial-gradient(circle at 50% 30%, var(--table-purple-light), var(--table-purple-dark));
    box-shadow: 0 0 50px rgba(0,0,0,0.5) inset;
}

/* 顶部 */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0; /* 防止被挤压 */
}
.brand {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    letter-spacing: 1px;
    color: #d1c4e9; /* 浅紫白 */
}
.wallet-box {
    background: rgba(0,0,0,0.4);
    padding: 5px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    border: 1px solid var(--gold-dim);
}
.wallet-icon { margin-right: 8px; font-size: 14px; }
#credits { color: var(--gold); font-weight: bold; font-family: 'Courier New', monospace; }

/* 📺 大屏幕 */
.screen-frame {
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}
.screen-inner {
    background: #000;
    width: 100%;
    border-radius: 8px;
    border: 2px solid #5e35b1; /* 紫色边框 */
    box-shadow: 0 0 20px rgba(94, 53, 177, 0.2);
    padding: 15px;
    text-align: center;
    position: relative;
}
.market-label { font-size: 12px; color: #9575cd; margin-bottom: 5px; text-transform: uppercase; }

.price-display {
    font-family: 'Courier New', monospace;
    font-size: 2.5rem; /* 稍微调小一点适配小屏 */
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}
.price-display .highlight {
    color: var(--gold);
    display: inline-block;
    padding: 0 8px;
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    background: rgba(241, 196, 15, 0.1);
}
.price-display .dim { color: #555; font-size: 0.8em; }

/* 进度条 */
.timer-bar-bg {
    width: 100%; height: 4px; background: #333; margin-top: 15px; border-radius: 2px;
}
#progress-fill {
    width: 0%; height: 100%; 
    background: linear-gradient(90deg, #9575cd, var(--gold)); /* 紫金渐变 */
    box-shadow: 0 0 10px var(--gold);
    transition: width 0.1s linear;
}
.status-text { margin-top: 8px; font-size: 12px; color: #b39ddb; }

/* 📜 路单 */
.roadmap-container {
    background: rgba(0,0,0,0.3);
    padding: 8px 10px;
    overflow-x: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
    margin-top: 10px;
}
.roadmap-scroll { display: flex; gap: 6px; justify-content: flex-start; }
/* style.css - 找到这一块 */

.bead {
    width: 22px; 
    height: 22px; 
    border-radius: 50%;
    text-align: center; 
    line-height: 22px;
    font-size: 11px; 
    font-weight: bold;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);

    /* 🔴 [新增核心修复] 禁止珠子被挤压 */
    flex-shrink: 0; 
}

.bead.big { background: #e74c3c; color: white; }
.bead.small { background: #3498db; color: white; }
.bead.win { border: 2px solid var(--gold); box-shadow: 0 0 5px var(--gold); }

/* 🎲 下注台面 (核心修复区) */
.betting-table {
    flex: 1; /* 占据剩余空间 */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 内容靠底 */
    padding: 10px 20px;
    
    /* 🛠️ 关键修复：底部留出足够空间 */
    padding-bottom: calc(20px + var(--safe-bottom)); 
}

/* 筹码架 */
/* =========================================
   🎰 真实质感筹码 (Realistic Clay Chips)
========================================= */

/* 筹码架容器 */
.chip-rack {
    display: flex; 
    justify-content: center; 
    gap: 12px; /* 间距稍紧一点 */
    margin-bottom: 25px;
    padding: 5px; /* 给阴影留点空间 */
}

/* 筹码基础结构 (容器) */
.chip {
    position: relative;
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-family: 'Roboto', sans-serif; font-size: 13px;
    color: #222; /* 文字在白底上，用深色 */
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    
    /* 去掉旧边框，用阴影制造立体感 */
    border: none;
    background: none; /* 背景交给伪元素 */
    z-index: 2;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8); /* 文字像刻印上去的 */
}

/* 选中状态：浮起 + 强阴影 */
.chip.selected {
    transform: translateY(-8px) scale(1.05);
    z-index: 3;
}

/* 🎨 层1：筹码主体与边缘花纹 (最底层) */
.chip::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    z-index: -2;

    /* 核心魔法：用重复圆锥渐变制造花纹 */
    /* 默认 8 花瓣结构 */
    background: repeating-conic-gradient(
        var(--chip-main) 0deg 36deg,  /* 主色区 占 36度 */
        var(--chip-spot) 36deg 45deg  /* 花纹区 占 9度 */
    );

    /* 边缘立体导角 */
    box-shadow: 
        inset 0 2px 3px rgba(255,255,255,0.3), /* 顶部高光 */
        inset 0 -2px 3px rgba(0,0,0,0.4),     /* 底部阴影 */
        0 4px 6px rgba(0,0,0,0.5);            /* 放在桌上的投影 */
}
.chip.selected::before {
    box-shadow: 
        inset 0 2px 3px rgba(255,255,255,0.4),
        inset 0 -2px 3px rgba(0,0,0,0.5),
        0 15px 25px rgba(0,0,0,0.6); /* 选中时投影拉长 */
}

/* 🎨 层2：中间的白色嵌体环 (Inlay) */
.chip::after {
    content: '';
    position: absolute;
    /* 调整这些值改变内圈大小 */
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    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; /* 极细的主色内描边 */
}

/* =========================================
   🎨 各面额配色方案 (统一为龙虎斗标准)
========================================= */

/* 🔵 10 - 龙虎斗同款蓝色 */
.chip-10 {
    --chip-main: #2980b9; /* 沉稳的蓝 */
    --chip-spot: #ecf0f1; /* 白条纹 */
}

/* 🟢 50 - 龙虎斗同款绿色 */
.chip-50 {
    --chip-main: #27ae60; /* 翡翠绿 */
    --chip-spot: #f1c40f; /* 金条纹 (配绿色很高级) */
}

/* ⚫ 100 - 龙虎斗同款黑色 (黑金) */
.chip-100 {
    --chip-main: #2c3e50; /* 哑光黑 */
    --chip-spot: #95a5a6; /* 银灰条纹 */
    /* 100筹码保持密集的条纹 */
}
.chip-100::before {
    background: repeating-conic-gradient(
        var(--chip-main) 0deg 22.5deg,
        var(--chip-spot) 22.5deg 30deg
    );
}

/* 🟣 500 - 紫色 (两边一致，保持不变) */
.chip-500 {
    --chip-main: #8e44ad; /* 皇家紫 */
    --chip-spot: #f1c40f; /* 金色条纹 */
}
.chip-500::after {
    background: #fcf3cf; /* 内圈带淡金 */
}

/* 🟡 ALL - 梭哈 (保持黑金尊贵感) */
.chip-all {
    --chip-main: #111;    /* 纯黑底 */
    --chip-spot: #f39c12; /* 亮橙金纹 */
    color: #e74c3c;       /* 红色文字示警 */
}
/* ... ALL 的其他样式保持不变 ... */


/* ========================================= */


/* 下注额显示徽标 */
.my-bet {
    font-size: 10px; color: var(--gold); 
    background: rgba(0,0,0,0.5); 
    border-radius: 4px; padding: 2px 4px;
    margin-top: 4px;
    min-height: 14px; /* 占位 */
}
.my-bet:empty { display: none; } /* 没下注时不显示 */

/* 🎯 数字狙击区 */
.sniper-grid-label {
    text-align: center; font-size: 10px; color: #aaa; margin: 15px 0 5px 0;
    letter-spacing: 2px;
}
.sniper-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5列，两行 */
    gap: 8px;
    margin-bottom: 10px;
}
.num-zone {
    border: 1px solid rgba(179, 157, 219, 0.2);
    border-radius: 4px;
    height: 36px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(30, 20, 50, 0.4);
    color: #d1c4e9;
    font-family: 'Courier New', monospace; font-weight: bold;
    cursor: pointer;
    position: relative;
}
.num-zone:active { background: rgba(255,255,255,0.1); }
.num-zone.active-bet {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(241, 196, 15, 0.1);
}
.my-bet-mini {
    position: absolute; bottom: -2px; right: -2px;
    font-size: 8px; color: #000; background: var(--gold);
    border-radius: 2px; padding: 0 2px;
    display: none;
}
.num-zone.active-bet .my-bet-mini { display: block; }


/* 下注网格 */
/* style.css - 终极修复版：恢复 2x2 网格 + 黄金角标 */

/* 1. 强制恢复 2列2行 布局 */
.bet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 强制分两列 */
    gap: 12px;
    margin-bottom: 15px;
    flex-shrink: 0; /* 防止被挤压 */
}

.bet-zone {
    position: relative;
    border: 1px solid rgba(179, 157, 219, 0.3);
    border-radius: 8px;
    background: rgba(30, 20, 50, 0.6);
    cursor: pointer;
    overflow: hidden;

    /* 内部元素垂直居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* 严格控制高度，防止撑爆屏幕 */
    height: 75px; 
    box-sizing: border-box;
    padding: 10px;
}

/* 选中后的视觉反馈 */
.bet-zone.active-bet {
    border-color: var(--gold);
    background: rgba(241, 196, 15, 0.05);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.1) inset;
}

/* 文字内容间距微调 */
.zone-name { font-family: 'Playfair Display', serif; font-size: 22px; color: #ede7f6; margin: 0; line-height: 1; }
.zone-odds { font-size: 11px; color: var(--gold); margin: 3px 0; line-height: 1; }
.zone-desc { font-size: 9px; color: #9575cd; opacity: 0.8; line-height: 1; }

/* 2. 统一角标样式 (复刻狙击区样式) */
.my-bet, .my-bet-mini {
    position: absolute;
    bottom: 0;
    right: 0;
    
    background: var(--gold);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-top-left-radius: 4px; /* 只给左上角圆角 */
    
    line-height: 12px;
    min-width: 16px;
    text-align: center;
    z-index: 10;
    display: none; /* 默认隐藏 */
}

/* 3. 筹码架位置固定，确保不会乱跑 */
.chip-rack {
    order: -1; /* 强制排在最前面 */
    margin-top: 10px;
    margin-bottom: 20px;
}


.dealer-msg {
    text-align: center; margin-top: 5px;
    font-size: 13px; color: #d1c4e9;
    height: 18px; line-height: 18px;
}


/* 可以在 style.css 末尾追加 */

.price-display .dim {
    color: #888; 
    font-weight: normal;
}

.price-display .highlight {
    font-size: 1.2em; /* 放大主角 */
    margin: 0 5px;    /* 给它点空间 */
    border: 1px solid var(--gold); /* 加上金框更明显 */
    background: rgba(241, 196, 15, 0.2);
}

