.legacy-game {
    min-height: calc(100dvh - 123px);
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

.draw-status {
    background: #fff;
    border-bottom: 7px solid #d5d5d5;
    font-variant-numeric: tabular-nums;
}

.draw-result-row,
.draw-period-row {
    min-width: 0;
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border-bottom: 1px solid #ddd;
}

.draw-result-row > b,
.draw-period-row > b {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.draw-result-row > span {
    color: #999;
    font-size: 12px;
}

.draw-balls {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.draw-balls::-webkit-scrollbar {
    display: none;
}

.draw-balls i {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 2px solid;
    border-radius: 50%;
    background: #fff;
    color: #161616;
    box-shadow: none;
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}

.draw-balls .ball-red { border-color: #ff525c; }
.draw-balls .ball-green { border-color: #70c745; }
.draw-balls .ball-blue { border-color: #45b8ed; }

.draw-balls.is-updating i {
    animation: draw-ball-reveal 560ms cubic-bezier(.2,.85,.35,1) both;
    animation-delay: calc(var(--ball-index, 0) * 65ms);
}

.draw-status.is-drawing .draw-result-row {
    background: linear-gradient(100deg, #fff 20%, #fff4f4 48%, #fff 76%);
    background-size: 220% 100%;
    animation: draw-awaiting 1.35s linear infinite;
}

@keyframes draw-ball-reveal {
    0% { opacity: 0; transform: translateY(-12px) scale(.45) rotate(-18deg); }
    65% { opacity: 1; transform: translateY(2px) scale(1.12) rotate(3deg); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes draw-awaiting {
    from { background-position: 120% 0; }
    to { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .draw-balls.is-updating i,
    .draw-status.is-drawing .draw-result-row { animation: none; }
}

.draw-status[data-family="pk10"] .draw-balls i,
.draw-status[data-family="lucky8"] .draw-balls i {
    border: 0;
    border-radius: 4px;
    color: #fff;
}

.draw-status[data-family="pk10"] .draw-balls .ball-red,
.draw-status[data-family="lucky8"] .draw-balls .ball-red { background: #e82931; }
.draw-status[data-family="pk10"] .draw-balls .ball-green,
.draw-status[data-family="lucky8"] .draw-balls .ball-green { background: #55aa36; }
.draw-status[data-family="pk10"] .draw-balls .ball-blue,
.draw-status[data-family="lucky8"] .draw-balls .ball-blue { background: #268bd8; }

.draw-period-row span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
}

.draw-period-row strong {
    min-width: 58px;
    padding: 2px 7px;
    border: 1px solid #b9bec3;
    border-radius: 15px;
    color: #e2555c;
    font-size: 14px;
    text-align: center;
}

#period-draw-countdown { color: #19b970; }
.draw-period-row a { margin-left: auto; color: #888; font-size: 12px; }

.bet-workspace {
    height: auto;
    min-height: calc(100dvh - 270px);
    align-items: stretch;
}

.play-categories {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(100dvh - 135px);
}

.play-panels {
    overflow: visible;
}

.compact-bet-slip {
    min-height: 64px;
    bottom: 65px;
    display: grid;
    grid-template-columns: 105px minmax(105px, 1fr) 72px 62px;
    align-items: center;
    gap: 8px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
}

.selected-summary {
    color: #444;
    font-size: 13px;
    white-space: nowrap;
}

.selected-summary b {
    color: #d51f31;
    font-size: 17px;
}

.compact-bet-slip label { display: block; }
.compact-bet-slip [data-bet-items] { display: none; }
.compact-bet-slip input {
    width: 100%;
    height: 44px;
    border-radius: 0;
    font-size: 14px;
}

.compact-bet-slip .bet-submit,
.compact-bet-slip .bet-reset {
    width: 100%;
    height: 44px;
    border-radius: 24px;
}

.compact-bet-slip .bet-reset {
    border: 1px solid #d45a5f;
    background: #fff;
    color: #bd4147;
}

.bet-closed-state {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    place-items: center;
    background: #333a;
    color: #fff;
    pointer-events: all;
}

.bet-closed-state[hidden] { display: none; }
.bet-closed-state b { font-size: 25px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 430px) {
    .draw-result-row,
    .draw-period-row { gap: 6px; padding-inline: 6px; }
    .draw-period-row > b { font-size: 12px; }
    .draw-period-row span { gap: 3px; font-size: 12px; }
    .draw-period-row strong { min-width: 48px; padding-inline: 4px; font-size: 12px; }
    .draw-period-row a { display: none; }
    .compact-bet-slip {
        grid-template-columns: 86px minmax(86px, 1fr) 65px 55px;
        gap: 5px;
        padding-inline: 7px;
    }
}
