/* ===== 幸运快3 下注弹窗 (.xyk3-*,独立前缀) =====
   三颗骰子 1-6,总和 3-18;混合面板 + 特码(4-17)面板。
   结构类同 am28/tw28,混合网格 2 列,特码网格 2 列(非 3 列)。 */
.xyk3-modal {
    position: fixed;
    inset: 0;
    z-index: 98;
    background: #f4f5f7;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.xyk3-modal[hidden] { display: none; }

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

.xyk3-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 10px 14px 12px;
    flex: 0 0 auto;
}
.xyk3-period {
    font-size: 13px;
    color: #ff4d4f;
    margin-bottom: 6px;
}
.xyk3-balls {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 8px;
}
.xyk3-tags {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 13px;
    color: #666;
}
.xyk3-tag b { color: #ff4d4f; font-weight: 700; }
.xyk3-tag-plain { color: #888; }
.xyk3-tag .xyk3-sum-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3a82ff;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    margin-left: 4px;
}

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

.xyk3-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;
}
.xyk3-next-period { color: #ff4d4f; }
.xyk3-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;
}
.xyk3-countdown.locked {
    background: #fff;
    color: #d7261e;
    border: 1px solid #d7261e;
    animation: xyk3CountdownBlink 0.6s ease-in-out infinite alternate;
}
@keyframes xyk3CountdownBlink {
    from { opacity: 1; }
    to   { opacity: 0.55; }
}
.xyk3-status { flex: 1; color: #666; transition: color 0.2s ease; }
.xyk3-status.locked { color: #d7261e; font-weight: 600; }
.xyk3-history-link { color: #ff6b48; }
.xyk3-history-link b { font-weight: 400; margin-left: 2px; }

.xyk3-play {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}
.xyk3-sidebar {
    width: 76px;
    background: #eee;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    border-right: 1px solid #e6e6e6;
}
.xyk3-side-tab {
    padding: 20px 0;
    text-align: center;
    font-size: 16px;
    color: #666;
    background: #e7e7e7;
    border-bottom: 1px solid #dcdcdc;
}
.xyk3-side-tab.active {
    background: #ff7a1a;
    color: #fff;
    font-weight: 500;
}
.xyk3-main {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    position: relative;
}
.xyk3-main-title {
    padding: 12px 0;
    text-align: center;
    color: #ff4d4f;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    background: #f7f7f7;
}
.xyk3-grid {
    display: grid;
    gap: 0;
    border-bottom: 1px solid #eee;
}
.xyk3-grid-2 { grid-template-columns: 1fr 1fr; }
.xyk3-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.xyk3-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;
}
.xyk3-grid-2 .xyk3-opt:nth-child(2n) { border-right: 0; }
.xyk3-grid-3 .xyk3-opt:nth-child(3n) { border-right: 0; }
.xyk3-opt:active { background: #fff4e8; }
.xyk3-opt.selected {
    background: #ff7a1a;
    color: #fff;
    box-shadow: none;
}
.xyk3-opt.selected .o,
.xyk3-opt.selected .n { color: #fff; }
.xyk3-opt .o { color: #ff7a1a; font-weight: 600; }
.xyk3-opt.low .o { color: #b5b5b5; font-weight: 500; }

/* 特码 4-17 两列数字格 */
.xyk3-num-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: #eee;
    border-top: 1px solid #eee;
}
.xyk3-num-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 22px;
    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;
}
.xyk3-num-grid .xyk3-num-opt:nth-child(2n) { border-right: 0; }
.xyk3-num-opt:active { background: #fff4e8; }
.xyk3-num-opt.selected { background: #ff7a1a; color: #fff; }
.xyk3-num-opt.selected .xyk3-num-ball {
    background: #fff;
    color: #333;
    text-shadow: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.xyk3-num-opt.selected .xyk3-num-ball::before { opacity: 0.4; }
.xyk3-num-opt.selected .xyk3-num-odds { color: #fff; font-weight: 600; }

.xyk3-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;
}
.xyk3-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;
}
.xyk3-num-odds {
    font-size: 14px;
    color: #999;
    font-weight: 500;
    flex: 1;
    text-align: right;
}

/* 底部快捷下单 */
.xyk3-quickbar {
    position: relative;
    background: #ff7a1a;
    color: #fff;
    padding: 20px 12px 14px;
    flex: 0 0 auto;
}
.xyk3-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);
}
.xyk3-quick-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.xyk3-quick-line:first-of-type { margin-top: 6px; }
.xyk3-quick-label {
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
}
.xyk3-chips {
    flex: 1;
    display: flex;
    gap: 6px;
    justify-content: space-between;
}
.xyk3-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;
}
.xyk3-chips button:active { background: #867f0d; }
#xyk3Amount {
    flex: 1;
    height: 32px;
    border: 0;
    border-radius: 4px;
    background: #fff;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.xyk3-buy, .xyk3-reset {
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    background: #3a1aa8;
    transition: opacity 0.15s ease;
    font-weight: 500;
}
.xyk3-reset { background: #d7261e; }
.xyk3-buy:active { background: #2a1278; }
.xyk3-reset:active { background: #a8140d; }

.xyk3-modal.locked .xyk3-buy {
    background: #6a5aa4;
    cursor: not-allowed;
    opacity: 0.7;
}
.xyk3-modal.locked .xyk3-opt,
.xyk3-modal.locked .xyk3-num-opt { pointer-events: none; opacity: 0.8; }
.xyk3-modal.locked .xyk3-mask-hint { display: block; }
.xyk3-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;
}

/* toast */
.xyk3-toast {
    position: absolute;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 10;
    white-space: nowrap;
}
.xyk3-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
