﻿/* Position selector bar: label + 3 chips + cancel/save */
title { display: none; }
.xyftft-pos-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px;
    background: #e8f0fb;
    border: 1px solid #bdc2c7;
    border-bottom: none;
    font-size: 13px;
    flex-wrap: nowrap;
    position: relative;
}

.xyftft-pos-bar .xyftft-pos-btn {
    margin-left: 6px;
}

/* Full-width slots row below the bar */
.xyftft-pos-slots-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    background: #f5f8ff;
    border: 1px solid #bdc2c7;
    border-bottom: none;
    flex-wrap: nowrap;
}

.xyftft-pos-wrapper {
    display: block;
    margin-top: -15px;
}

.xyftft-pos-label {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    margin-right: 4px;
}

/* The 3 placeholder chips shown next to the label */
.xyftft-pos-sel-placeholder {
    display: inline-block;
    min-width: 38px;
    padding: 2px 8px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    color: #aaa;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s;
}
.xyftft-pos-sel-placeholder.filled {
    border: 1px solid #aaa;
    background: #B9C2CB;
    color: #1a4d99;
    font-weight: bold;
    text-align: center;
}

/* Full-width slots row below the bar */
.xyftft-pos-slots-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    background: #f5f8ff;
    border: 1px solid #bdc2c7;
    border-bottom: none;
    flex-wrap: nowrap;
}

.xyftft-pos-slot {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 46px;
    padding: 4px 6px;
    border: 1px solid #bdc2c7;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #555;
    user-select: none;
    transition: background 0.15s, opacity 0.15s;
    position: relative;
    flex: 1;
}

.xyftft-pos-slot:hover {
    background: #bcd8fb;
}

.xyftft-pos-slot.selected {
    background: #ffc214;
    border-color: #e0a800;
    color: #333;
    font-weight: bold;
}

.xyftft-pos-slot.locked {
    background: #ffc214;
    border-color: #e0a800;
    color: #333;
    font-weight: bold;
}

.xyftft-pos-slot.dimmed {
    opacity: 0.35;
}

/* ✕ deselect button — shown on selected slots only */
.xyftft-pos-remove {
    display: none;
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 10px;
    color: #c0392b;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}
.xyftft-pos-slot.selected .xyftft-pos-remove {
    display: block;
}

/* Green tick — shown on locked slots only */
.xyftft-pos-tick {
    display: none;
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 10px;
    color: #27ae60;
    font-weight: bold;
    line-height: 1;
}
.xyftft-pos-slot.locked .xyftft-pos-tick {
    display: block;
}

.xyftft-pos-btn {
    padding: 3px 12px;
    border-radius: 4px;
    border: 1px solid #bdc2c7;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.xyftft-pos-btn.xyftft-pos-save {
    background: #2161b3;
    color: #fff;
    border-color: #1a4d99;
}

.xyftft-pos-btn.xyftft-pos-save:hover {
    background: #1a4d99;
}

.xyftft-pos-btn.xyftft-pos-cancel,
.xyftft-pos-btn.xyftft-pos-edit {
    background: #e8f0fb;
    color: #1a4d99;
}

/* Push the button group to the right as a unit */
.xyftft-pos-bar .xyftft-pos-cancel,
.xyftft-pos-bar .xyftft-pos-edit {
    margin-left: auto;
}

.xyftft-pos-bar .xyftft-pos-save {
    margin-left: 4px;
}

.xyftft-pos-chips {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.xyftft-pos-btn.xyftft-pos-cancel:hover,
.xyftft-pos-btn.xyftft-pos-edit:hover {
    background: #bdc2c7;
}

/* Dim non-selected position balls in top banner */
.xyftft-ball-dim {
    opacity: 0.25;
}

/* XYFTFT result table: 10 ball columns */
.table_ball .name_XYFTFT span {
    background: url("images/ball-pk.png") no-repeat;
    display: inline-block;
    width: 27px;
    height: 20px;
    font-size: 0px;
    text-indent: -99999px;
    vertical-align: middle;
}
.table_ball .name_XYFTFT {
    vertical-align: middle !important;
    text-align: center !important;
}
.dresult-table .table_ball .name_XYFTFT,
#drawInfo .table_ball .name_XYFTFT {
    padding: 4px 8px !important;
    width: 30px;
}
.table_ball .name_XYFTFT .b01 { background-position: 0 0; }
.table_ball .name_XYFTFT .b02 { background-position: 0 -21px; }
.table_ball .name_XYFTFT .b03 { background-position: 0 -42px; }
.table_ball .name_XYFTFT .b04 { background-position: 0 -63px; }
.table_ball .name_XYFTFT .b05 { background-position: 0 -84px; }
.table_ball .name_XYFTFT .b06 { background-position: 0 -105px; }
.table_ball .name_XYFTFT .b07 { background-position: 0 -126px; }
.table_ball .name_XYFTFT .b08 { background-position: 0 -147px; }
.table_ball .name_XYFTFT .b09 { background-position: 0 -168px; }
.table_ball .name_XYFTFT .b10 { background-position: 0 -189px; }

/* Make 长龙 the same height as the betting table and scrollable */
.L_XYFTFT #changlong th:first-child {
    white-space: nowrap;
    font-size: 11px;
}

.L_XYFTFT #changlong th:nth-child(2) {
    text-align: center;
    white-space: nowrap;
}

.L_XYFTFT #changlong thead {
    display: table-header-group;
}

.L_XYFTFT #changlong tbody {
    display: block;
    overflow-y: auto;
    max-height: 385px;
    width: 100%;
}

.L_XYFTFT #changlong tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* Badge images in position slots and popup */
.xyftft-pos-ball {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

.xyftft-pos-slot {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    min-width: unset;
    flex: 1;
    border-radius: 0;
    border-right: none;
}

.xyftft-pos-slot:last-child {
    border-right: 1px solid #bdc2c7;
}

.xyftft-pos-name {
    font-size: 11px;
    white-space: nowrap;
}

.xyftft-pos-slots-row {
    flex-wrap: nowrap;
    overflow-x: hidden;
    gap: 0;
    padding: 0;
    justify-content: stretch;
    border-bottom: 1px solid #bdc2c7;
}

/* Red error state wraps BOTH rows as one unit */
.xyftft-pos-wrapper.xyftft-pos-error {
    outline: 2px solid #e74c3c;
    outline-offset: -1px;
}
.xyftft-pos-wrapper.xyftft-pos-error .xyftft-pos-slot.dimmed {
    opacity: 1 !important;
}
/* Green checkmark shown after all 3 positions are selected */
.xyftft-pos-check {
    display: none;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    margin-left: 4px;
    vertical-align: middle;
}
.xyftft-pos-check.visible {
    display: inline-block;
}

.xyftft-pos-wrapper.xyftft-pos-error .xyftft-pos-slot {
    opacity: 1 !important;
    background: #fff !important;
}
.xyftft-pos-wrapper.xyftft-pos-error .xyftft-pos-slots-row {
    background: #fff !important;
}

/* Info icon button next to label */
.xyftft-pos-info-btn {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background: #8e9bae;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    font-style: normal;
    cursor: pointer;
    margin-left: 2px;
    vertical-align: middle;
}

/* Fix alignment of count/total row in bet confirmation dialog */
#betsBox .bottom {
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
#betsBox .bottom #bcount {
    flex: 0 0 auto;
    width: auto;
    padding: 0 12px;
    box-sizing: border-box;
}
#betsBox .bottom #btotal {
    flex: 1 1 auto;
    width: auto;
    padding: 0 12px;
    text-align: center;
    box-sizing: border-box;
}

#drawInfo .balls b {
    background: url("images/ball-pk.png") no-repeat;
    width: 20px;
    height: 20px;
    display: block;
    margin: 2px 1px;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    line-height: 0;
}
#drawInfo .balls .b1  { background-position: 0 0; }
#drawInfo .balls .b2  { background-position: 0 -21px; }
#drawInfo .balls .b3  { background-position: 0 -42px; }
#drawInfo .balls .b4  { background-position: 0 -63px; }
#drawInfo .balls .b5  { background-position: 0 -84px; }
#drawInfo .balls .b6  { background-position: 0 -105px; }
#drawInfo .balls .b7  { background-position: 0 -126px; }
#drawInfo .balls .b8  { background-position: 0 -147px; }
#drawInfo .balls .b9  { background-position: 0 -168px; }
#drawInfo .balls .b10 { background-position: 0 -189px; }

/* Fan result (番) in dresult table — colour coded by number */
.xyftft-fan-result {
    font-weight: bold;
}
.xyftft-fan-1 { color: #53B1EF !important; }
.xyftft-fan-2 { color: #54C880 !important; }
.xyftft-fan-3 { color: #E9BE00 !important; }
.xyftft-fan-4 { color: #EE5B61 !important; }

/* Vertically center the 3 position balls in dresult */
.table_ball td.name_XYFTFT span {
    vertical-align: middle;
    margin-top: 0;
}
