/* ===== 澳门幸运28 下注弹窗 (.gm-*) ===== */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 98;
    background: #f4f5f7;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.game-modal[hidden] { display: none; }

.gm-topbar {
    height: 54px;
    background: #ff5a4c;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 4px;
    flex: 0 0 auto;
}
.gm-back {
    width: 36px; height: 36px;
    background: transparent; border: 0; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.gm-back svg { width: 22px; height: 22px; stroke: #fff; }
.gm-title {
    flex: 1;
    text-align: center;
    color: #fff;
    font-size: 17px;
    font-weight: 500;
}
.gm-history-btn {
    width: 36px; height: 36px;
    background: transparent; border: 0; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.gm-history-btn svg { width: 22px; height: 22px; }
.gm-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    overflow: hidden; margin-left: 4px;
    display: inline-flex; align-items: center; justify-content: center;
}
.gm-avatar svg { width: 32px; height: 32px; }

/* 上一期开奖 */
.gm-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 10px 14px 12px;
    flex: 0 0 auto;
}
.gm-period {
    font-size: 13px;
    color: #ff4d4f;
    margin-bottom: 6px;
}
.gm-balls {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 8px;
}
.gm-ball {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222;
    font-weight: 700;
    font-size: 14px;
    position: relative;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.25),
        inset -3px -4px 8px rgba(0,0,0,0.22),
        inset 3px 4px 8px rgba(255,255,255,0.32);
}
.gm-ball::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 7px;
    width: 10px;
    height: 6px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}
.gm-ball.b-red    { background: radial-gradient(circle at 50% 50%, #fff 0 40%, transparent 41%), radial-gradient(circle at 32% 32%, #ffb1a8, #e63b2f 65%, #a31b10); }
.gm-ball.b-blue   { background: radial-gradient(circle at 50% 50%, #fff 0 40%, transparent 41%), radial-gradient(circle at 32% 32%, #adcdff, #3a82ff 65%, #1a4bb8); }
.gm-ball.b-green  { background: radial-gradient(circle at 50% 50%, #fff 0 40%, transparent 41%), radial-gradient(circle at 32% 32%, #b8efbd, #3ac24a 65%, #198726); }
.gm-ball.b-gray   { background: radial-gradient(circle at 50% 50%, #fff 0 40%, transparent 41%), radial-gradient(circle at 32% 32%, #d4d4d4, #888 65%, #555); }
.gm-tags {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 13px;
    color: #666;
}
.gm-tag b { color: #ff4d4f; font-weight: 700; }
.gm-tag-plain { color: #888; }

.gm-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #ff4d4f;
    font-weight: 700;
    font-size: 13px;
}
.gm-balance svg { width: 32px; height: 32px; }

/* 下一期倒计时条 */
.gm-next {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: #fff;
    border-top: 1px solid #f0e2e0;
    font-size: 13px;
    color: #555;
    flex: 0 0 auto;
}
.gm-next-period { color: #ff4d4f; }
.gm-countdown {
    background: #d7261e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    transition: background 0.2s ease;
}
.gm-countdown.locked {
    background: #fff;
    color: #d7261e;
    border: 1px solid #d7261e;
    animation: countdownBlink 0.6s ease-in-out infinite alternate;
}
@keyframes countdownBlink {
    from { opacity: 1; }
    to   { opacity: 0.55; }
}
.gm-status { flex: 1; color: #666; transition: color 0.2s ease; }
.gm-status.locked { color: #d7261e; font-weight: 600; }
.gm-history-link { color: #ff6b48; }
.gm-history-link b { font-weight: 400; margin-left: 2px; }

/* 玩法区 */
.gm-play {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}
.gm-sidebar {
    width: 76px;
    background: #eee;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    border-right: 1px solid #e6e6e6;
}
.gm-side-tab {
    padding: 20px 0;
    text-align: center;
    font-size: 16px;
    color: #666;
    background: #e7e7e7;
    border-bottom: 1px solid #dcdcdc;
}
.gm-side-tab.active {
    background: #ff7a1a;
    color: #fff;
    font-weight: 500;
}
.gm-main {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    position: relative;
}
.gm-main-title {
    padding: 12px 0;
    text-align: center;
    color: #ff4d4f;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    background: #f7f7f7;
}
.gm-grid {
    display: grid;
    gap: 0;
    border-bottom: 1px solid #eee;
}
.gm-grid-2 { grid-template-columns: 1fr 1fr; }
.gm-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.gm-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 15px;
    color: #333;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}
.gm-grid-2 .gm-opt:nth-child(2n) { border-right: 0; }
.gm-grid-3 .gm-opt:nth-child(3n) { border-right: 0; }
.gm-opt:active { background: #fff4e8; }
.gm-opt.selected {
    background: #ff7a1a;
    color: #fff;
    box-shadow: none;
}
.gm-opt.selected .o,
.gm-opt.selected .n { color: #fff; }
.gm-opt .o { color: #ff7a1a; font-weight: 600; }
.gm-opt.low .o { color: #b5b5b5; font-weight: 500; }
.gm-opt .n.tag-red   { color: #e63b2f; }
.gm-opt .n.tag-green { color: #2aa13a; }
.gm-opt .n.tag-blue  { color: #2c6fe0; }

.gm-sub-title {
    font-size: 13px;
    color: #999;
    padding: 10px 14px 6px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

/* 特码 0-27 数字球网格 */
.gm-num-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: #eee;
    border-top: 1px solid #eee;
}
.gm-num-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}
.gm-num-grid .gm-num-opt:nth-child(3n) { border-right: 0; }
.gm-num-opt:active { background: #fff4e8; }
.gm-num-opt.selected {
    background: #ff7a1a;
    color: #fff;
}
.gm-num-opt.selected .gm-num-ball {
    background: #fff;
    color: #333;
    text-shadow: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.gm-num-opt.selected .gm-num-ball::before { opacity: 0.4; }
.gm-num-opt.selected .gm-num-odds { color: #fff; font-weight: 600; }

.gm-num-ball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex: 0 0 auto;
    position: relative;
    background: radial-gradient(circle at 32% 32%, #7a7a7a, #3a3a3a 70%, #1a1a1a);
    box-shadow:
        0 1px 2px rgba(0,0,0,0.3),
        inset -2px -2px 5px rgba(0,0,0,0.3),
        inset 2px 2px 5px rgba(255,255,255,0.25);
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    transition: background 0.15s ease, color 0.15s ease;
}
.gm-num-ball::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 9px;
    height: 5px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.7), rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.gm-num-odds {
    font-size: 14px;
    color: #999;
    font-weight: 500;
    flex: 1;
    text-align: right;
}

/* 余额颜色可动 */
.gm-balance.warn span { color: #d7261e; }

/* ===== 底部快捷下单 ===== */
.gm-quickbar {
    position: relative;
    background: #ff7a1a;
    color: #fff;
    padding: 20px 12px 14px;
    flex: 0 0 auto;
}
.gm-tip-pill {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #d7261e;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.gm-quick-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.gm-quick-line:first-of-type { margin-top: 6px; }
.gm-quick-label {
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
}
.gm-chips {
    flex: 1;
    display: flex;
    gap: 6px;
    justify-content: space-between;
}
.gm-chips button {
    flex: 1;
    height: 32px;
    border-radius: 50%;
    background: #a6a112;
    color: #fff;
    border: 0;
    font-size: 13px;
    cursor: pointer;
    min-width: 32px;
    max-width: 48px;
    aspect-ratio: 1;
    padding: 0;
}
.gm-chips button:active { background: #867f0d; }
#gmAmount {
    flex: 1;
    height: 32px;
    border: 0;
    border-radius: 4px;
    background: #fff;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.gm-buy, .gm-reset {
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    background: #d7261e;
    transition: opacity 0.15s ease;
}
.gm-reset { background: #d7261e; }
.gm-buy:active, .gm-reset:active { background: #a8140d; }

.game-modal.locked .gm-buy {
    background: #aa5a4c;
    cursor: not-allowed;
    opacity: 0.7;
}
.game-modal.locked .gm-opt { pointer-events: none; opacity: 0.8; }
.game-modal.locked .gm-mask-hint {
    display: block;
}
.gm-mask-hint {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 12px;
    z-index: 2;
    white-space: nowrap;
    pointer-events: none;
}
