/* =========================================
   1. 全局定义 & ENTP 变量系统
   ========================================= */
:root {
    /* 核心色板 */
    --bg-body: #121212;
    --bg-cabinet: #2e1a47;      /* 机柜主体：深邃紫 */
    --bg-panel: #1a0f2e;        /* 面板底色：更深的紫 */
    /* 灯光系统 */
    --neon-purple: #b39ddb;
    --neon-pink: #ff0055;
    --neon-cyan: #00e5ff;
    --neon-gold: #ffd700;
    --neon-green: #00ff00;
    /* 材质 */
    --glass-shine: rgba(255, 255, 255, 0.1);
    --shadow-inset: inset 0 2px 5px rgba(0,0,0,0.5);
}
* {
    box-sizing: border-box;
    user-select: none; /* 禁止选中文本，像原生App */
}
body {
    background: var(--bg-body);
    font-family: 'Courier New', 'Monaco', monospace; /* 复古代码风 */
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
}
/* =========================================
   2. 机柜外壳 (Container)
   ========================================= */
.cabinet-container {
    background: var(--bg-cabinet);
    width: 100%;
    max-width: 480px; /* 限制最大宽度，适配手机 */
    border-radius: 20px;
    padding: 15px;
    box-shadow:
        0 0 0 2px #4a3570,
        0 0 50px rgba(94, 53, 177, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* =========================================
   3. 区域一：顶层数据看板 (HUD)
   ========================================= */
.top-hud {
    display: flex;
    justify-content: space-between;
    background: #000;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #333;
}
.hud-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.hud-group:last-child {
    align-items: flex-end;
}
.hud-label {
    font-size: 10px;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
/* LED 数码管风格 */
.led-display {
    font-family: 'Impact', sans-serif; /* 临时替代数码管字体 */
    background: #000;
    color: var(--neon-cyan);
    padding: 2px 6px;
    border-radius: 4px;
    text-shadow: 0 0 5px var(--neon-cyan);
    letter-spacing: 2px;
}
.led-display.red {
    color: var(--neon-pink);
    text-shadow: 0 0 5px var(--neon-pink);
}
.led-display.lg { font-size: 24px; }
.led-display.sm { font-size: 18px; color: #aaa; text-shadow: none; }
.led-display.xs { font-size: 14px; width: 100%; text-align: center; margin-bottom: 4px; border: 1px solid #333; }
/* =========================================
   4. 区域二 & 三：主游戏区 (Grid Stage)
   ========================================= */
.machine-stage {
    position: relative;
    background: #000;
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-inset);
    /* 保持正方形 */
    aspect-ratio: 1/1;
    display: grid;
    /* 7x7 网格：四周跑道，中间空出 */
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 4px;
}
/* 跑道格子 (由JS动态生成) */
.slot-cell {
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem; /* Emoji 大小 */
    position: relative;
}
/* 大水果：图标大一点 */
.slot-cell .icon {
    font-size: 1.4rem;
}
/* 小水果：图标缩小，给标签留位置 */
.slot-cell.small-item .icon {
    font-size: 1.0rem;
    transform: translateY(-5px); /* 往上提一点 */
}
/* 标签样式 (x2, x50) */
.slot-cell .tag {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    color: var(--neon-gold);
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    background: rgba(0,0,0,0.5); /* 加个黑底衬托 */
    padding: 0 3px;
    border-radius: 4px;
}
/* 小图标标记 (x2, x50等) */
.slot-cell .tag {
    position: absolute;
    bottom: 0;
    right: 2px;
    font-size: 8px;
    color: var(--neon-gold);
    font-weight: bold;
}
/* 激活高亮状态 (光标) */
.slot-cell.active {
    background: #fff;
    box-shadow:
        inset 0 0 10px #ffff00,
        0 0 15px var(--neon-gold);
    z-index: 10;
    border-color: #fff;
    transform: scale(1.05);
}
/* 中央舞台 (跨越中间 5x5) */
.center-stage {
    grid-column: 2 / 7; /* 横跨第2到第6列 */
    grid-row: 2 / 7;    /* 横跨第2到第6行 */
    background: radial-gradient(circle at center, #2e1a47 0%, #000 100%);
    border-radius: 8px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.neon-text {
    font-size: 40px;
    color: rgba(255,255,255,0.1);
    margin: 0;
    text-transform: uppercase;
    /* 简单的呼吸灯效 */
    animation: text-flicker 3s infinite alternate;
}
/* 中间得分板 */
.center-led {
    background: rgba(0,0,0,0.8);
    border: 2px solid #555;
    padding: 5px 15px;
    border-radius: 4px;
    margin-top: 10px;
}
#center-score {
    font-size: 28px;
    color: var(--neon-gold);
    font-weight: bold;
}
/* =========================================
   5. 区域四：功能控制区 (Function Panel)
   ========================================= */
.function-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    padding: 10px;
    border-radius: 10px;
    border-top: 2px solid #4a3570;
}
.func-group {
    display: flex;
    gap: 8px;
}
/* 通用功能按钮 */
.btn-func {
    background: linear-gradient(to bottom, #444, #222);
    border: 1px solid #555;
    color: #fff;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 3px 0 #000;
    text-align: center;
    min-width: 45px;
}
.btn-func:active { transform: translateY(3px); box-shadow: none; }
.btn-func:disabled { opacity: 0.3; cursor: not-allowed; }
/* 猜大小区域 */
.arrows { display: flex; gap: 5px; align-items: center; }
.arrow-light {
    font-size: 14px;
    color: #333;
    text-shadow: none;
    background: #000;
    width: 20px; height: 20px;
    text-align: center;
    border-radius: 4px;
}
.arrow-light.on { color: var(--neon-green); text-shadow: 0 0 5px var(--neon-green); }
/* 巨大的开始按钮 */
.btn-start {
    background: linear-gradient(135deg, #d50000, #b71c1c);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 5px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 0 #7f0000, 0 0 10px rgba(255,0,0,0.3);
    cursor: pointer;
    min-width: 80px;
}
.btn-start .txt { font-size: 16px; font-weight: bold; }
.btn-start .sub { font-size: 8px; opacity: 0.8; }
.btn-start:active { transform: translateY(4px); box-shadow: 0 0 10px rgba(255,0,0,0.3); }
/* =========================================
   6. 区域五：押注键盘 (Betting Panel)
   ========================================= */
.bet-keyboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* 8列 */
    gap: 4px;
    background: #000;
    padding: 8px;
    border-radius: 10px;
}
.bet-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 押注按钮 */
.btn-bet {
    background: linear-gradient(to bottom, #ffd54f, #ff6f00); /* 经典琥珀色 按钮 */
    border: none;
    border-radius: 4px;
    width: 100%;
    padding: 6px 2px;
    font-size: 12px;
    font-weight: bold;
    color: #3e2723;
    box-shadow: 0 3px 0 #bf360c;
    cursor: pointer;
    text-align: center;
    line-height: 1.1;
}
.btn-bet .odds {
    display: block;
    font-size: 9px;
    color: #000;
    margin-top: 2px;
}
.btn-bet:active {
    transform: translateY(3px);
    box-shadow: none;
}
/* =========================================
   7. 动画定义
   ========================================= */
@keyframes text-flicker {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(255,255,255,0.2); }
    50% { opacity: 0.8; text-shadow: 0 0 20px var(--neon-purple); }
}
/* 响应式微调 */
@media screen and (max-width: 360px) {
    .btn-bet { font-size: 10px; padding: 4px 1px; }
    .led-display.lg { font-size: 20px; }
    .neon-text { font-size: 30px; }
}
/* === 补丁：解除 Grid 封印 === */
#slot-track {
    display: contents;
}

