.splash-screen::after,
.splash-screen::before {
    content: '';
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 0;
    border-radius: 50%
}

.splash-ball,
.splash-screen,
.tab-btn {
    -webkit-tap-highlight-color: transparent
}

.btn-all,
.tab-btn {
    cursor: pointer;
    font-weight: 600
}

.badge,
.splash-title,
.tab-btn,
.toast-msg {
    white-space: nowrap
}

.modal-input-row input,
.verify-input-row input {
    outline: 0;
    font-family: inherit;
    text-align: center
}

.ai-freq-label,
.ai-placeholder,
.ai-reco-label,
.footer-note,
.line-label,
.modal-input-row input,
.multi-result-placeholder,
.saved-empty,
.subhead,
.tab-btn,
.ticket-label,
.verify-input-row input {
    text-align: center
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(145deg, #f7f9fc 0, #e9eef4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0d1b2a 0, #1a2e3f 30%, #162535 60%, #0f1f30 100%);
    overflow: hidden;
    opacity: 1;
    transition: opacity .45s cubic-bezier(.4, 0, .6, 1);
    pointer-events: auto
}

.splash-content,
.system-container {
    flex-direction: column;
    position: relative
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none
}

.splash-screen::before {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at center, rgba(255, 140, 80, .22) 0, rgba(255, 100, 60, .08) 35%, transparent 70%);
    top: 50%;
    left: 50%;
    animation: 3.5s ease-in-out infinite splashGlowPulse;
    pointer-events: none
}

.splash-screen::after {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle at center, rgba(100, 180, 255, .18) 0, rgba(80, 150, 240, .06) 30%, transparent 65%);
    top: 42%;
    left: 48%;
    animation: 4.2s ease-in-out 1.5s infinite splashGlowPulse;
    pointer-events: none
}

.modal-overlay.show .modal-dialog,
.toast-msg.show {
    transform: translateY(0)
}

@keyframes splashGlowPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: .7
    }

    35% {
        transform: translate(-48%, -52%) scale(1.25);
        opacity: 1
    }

    70% {
        transform: translate(-52%, -48%) scale(1.1);
        opacity: .6
    }
}

.splash-content {
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 18px
}

.splash-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #f0e6d8;
    letter-spacing: 3px;
    text-shadow: 0 0 30px rgba(255, 180, 120, .4), 0 0 60px rgba(255, 140, 80, .2);
    animation: .7s ease-out both splashTitleFadeIn
}

.splash-subtitle {
    font-size: clamp(.7rem, 1.8vw, .85rem);
    color: #a0b8cc;
    letter-spacing: 2px;
    font-weight: 400;
    animation: .7s ease-out .15s both splashTitleFadeIn;
    opacity: .75
}

@keyframes splashTitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
        filter: blur(4px)
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0)
    }
}

.splash-balls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.5vw, 12px);
    flex-wrap: wrap;
    padding: 6px 10px
}

.splash-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(38px, 9vw, 56px);
    height: clamp(38px, 9vw, 56px);
    border-radius: 50%;
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.55rem);
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
    border: 1.5px solid rgba(255, 255, 255, .45);
    box-shadow: 0 6px 0 rgba(0, 0, 0, .15), 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px rgba(255, 255, 255, .5);
    animation: 1.6s cubic-bezier(.28, .84, .42, 1) infinite splashBallBounce;
    flex-shrink: 0;
    user-select: none
}

.splash-ball:first-child {
    animation-delay: 0s
}

.splash-ball:nth-child(2) {
    animation-delay: .1s
}

.splash-ball:nth-child(3) {
    animation-delay: .2s
}

.splash-ball:nth-child(4) {
    animation-delay: .3s
}

.splash-ball:nth-child(5) {
    animation-delay: .4s
}

.splash-ball:nth-child(6) {
    animation-delay: .5s
}

.splash-ball:nth-child(7) {
    animation-delay: .6s
}

@keyframes splashBallBounce {

    0%,
    100%,
    94% {
        transform: translateY(0) scale(1)
    }

    18% {
        transform: translateY(-26px) scale(1.06)
    }

    36% {
        transform: translateY(0) scale(.96)
    }

    54% {
        transform: translateY(-11px) scale(1.03)
    }

    70% {
        transform: translateY(0) scale(.98)
    }

    84% {
        transform: translateY(-4px) scale(1.01)
    }
}

.splash-ball.ball-w1 {
    background: radial-gradient(circle at 30% 28%, #ffb08c, #e1552e);
    background-color: #e1552e;
    box-shadow: 0 6px 0 #a3361c, 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px #ffe0d0
}

.splash-ball.ball-w2 {
    background: radial-gradient(circle at 30% 28%, #ff9a7a, #d9442f);
    background-color: #d9442f;
    box-shadow: 0 6px 0 #9a2a1a, 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px #ffd4c4
}

.splash-ball.ball-w3 {
    background: radial-gradient(circle at 30% 28%, #ff7b7b, #c92a2a);
    background-color: #c92a2a;
    box-shadow: 0 6px 0 #8a1818, 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px #ffc9c9
}

.splash-ball.ball-w4 {
    background: radial-gradient(circle at 30% 28%, #ffc090, #e87a3e);
    background-color: #e87a3e;
    box-shadow: 0 6px 0 #b05520, 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px #ffe8d0
}

.splash-ball.ball-w5 {
    background: radial-gradient(circle at 30% 28%, #ffd0a0, #f0a030);
    background-color: #f0a030;
    box-shadow: 0 6px 0 #c07a18, 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px #fff2dc
}

.splash-ball.ball-c1 {
    background: radial-gradient(circle at 30% 28%, #7ec8ff, #1a73e8);
    background-color: #1a73e8;
    box-shadow: 0 6px 0 #0f4a9e, 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px #c6e2ff
}

.splash-ball.ball-c2 {
    background: radial-gradient(circle at 30% 28%, #90d0ff, #0d6efd);
    background-color: #0d6efd;
    box-shadow: 0 6px 0 #0a4da0, 0 8px 14px rgba(0, 0, 0, .18), inset 0 -3px 5px rgba(0, 0, 0, .12), inset 0 3px 6px #b6d9ff
}

.splash-loading-row {
    display: flex;
    align-items: center;
    gap: 3px;
    animation: .7s ease-out .3s both splashTitleFadeIn
}

.splash-loading-text {
    font-size: .8rem;
    color: #8aa0b8;
    letter-spacing: 1.5px;
    font-weight: 500
}

.toast-msg,
h1 {
    font-weight: 600
}

.splash-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b0c8dc;
    animation: 1.4s ease-in-out infinite splashDotBlink
}

.splash-dot:nth-child(2) {
    animation-delay: .18s
}

.splash-dot:nth-child(3) {
    animation-delay: .36s
}

.splash-dot:nth-child(4) {
    animation-delay: .54s
}

@keyframes splashDotBlink {

    0%,
    100%,
    60% {
        opacity: .25;
        transform: scale(.7)
    }

    30% {
        opacity: 1;
        transform: scale(1.3);
        background: #e8c8a0
    }
}

.system-container {
    max-width: 1100px;
    width: 100%;
    background: rgba(255, 255, 255, .75);
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 10, 30, .12), 0 6px 12px rgba(0, 0, 0, .05);
    padding: 24px 20px 20px;
    border: 1px solid rgba(255, 255, 255, .5);
    transition: .2s;
    display: flex;
    max-height: 98vh;
    max-height: 98dvh;
    overflow: hidden
}

.toast-msg,
h1 span {
    background: #1e2b3c;
    color: #fff;
    font-size: .85rem;
    letter-spacing: 1px
}

.toast-container {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px
}

.tab-btn,
.tabs-nav,
.tabs-panels {
    position: relative
}

.toast-msg {
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .3s, transform .3s
}

.toast-msg.show {
    opacity: 1
}

.toast-msg.success {
    background: #2d5a27;
    color: #e8f5e9
}

.toast-msg.error {
    background: #c0392b;
    color: #ffeaea
}

h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 2rem;
    letter-spacing: 2px;
    color: #1e2b3c;
    margin-bottom: 2px;
    flex-shrink: 0;
    line-height: 1.2
}

h1 span {
    padding: 3px 14px;
    border-radius: 40px;
    opacity: .8
}

.subhead {
    color: #546e7a;
    margin-bottom: 6px;
    font-weight: 400;
    border-bottom: 1px solid rgba(84, 110, 122, .12);
    padding-bottom: 8px;
    font-size: .9rem;
    flex-shrink: 0;
    line-height: 1.3
}

.tabs-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden
}

.tabs-nav {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    z-index: 2;
    margin-bottom: -1px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
}

.tabs-nav::-webkit-scrollbar {
    height: 0
}

.tab-btn {
    flex: 1 0 auto;
    min-width: 0;
    padding: 14px 8px 16px;
    border: 1.5px solid rgba(180, 200, 220, .5);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    background: rgba(235, 240, 248, .65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: .85rem;
    color: #5e7a90;
    letter-spacing: .5px;
    transition: .25s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .03);
    user-select: none
}

.tab-btn:hover {
    background: rgba(248, 250, 254, .85);
    color: #3a546d;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, .05)
}

.tab-btn:active {
    background: rgba(255, 255, 255, .9)
}

.tab-btn.active {
    background: #fff;
    color: #1a2e3f;
    border-color: rgba(200, 215, 230, .7);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, .06), 0 0 0 1px rgba(255, 255, 255, .8);
    z-index: 3;
    font-weight: 700;
    padding-bottom: 18px;
    margin-bottom: -2px
}

.tab-btn .tab-icon {
    font-size: 1.1rem;
    flex-shrink: 0
}

.tab-btn .tab-badge {
    font-size: .6rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .3px;
    flex-shrink: 0
}

.tab-btn:first-child .tab-badge {
    background: #cfdde9;
    color: #1e3b4f
}

.tab-btn:nth-child(2) .tab-badge {
    background: #e8d5b7;
    color: #5c3d1e
}

.tab-btn:nth-child(3) .tab-badge {
    background: #d4e8d4;
    color: #2d5a27
}

.tab-btn:nth-child(4) .tab-badge {
    background: #e0d4f0;
    color: #4a2d7a
}

.tab-btn.active .tab-badge {
    opacity: 1;
    font-weight: 600
}

.tabs-panels {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 0 24px;
    background: #fff;
    border-radius: 0 0 28px 28px;
    border: 1px solid rgba(200, 215, 230, .55);
    box-shadow: 0 8px 24px -8px rgba(0, 20, 40, .1);
    z-index: 1
}

.tab-panel {
    display: none;
    padding: 16px 18px 20px;
    animation: .3s fadeSlideIn
}

.tab-panel.active {
    display: block
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.tabs-panels::-webkit-scrollbar {
    width: 5px
}

.tabs-panels::-webkit-scrollbar-track {
    background: 0 0;
    border-radius: 10px
}

.tabs-panels::-webkit-scrollbar-thumb {
    background: #c8d6e0;
    border-radius: 10px
}

.action-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 14px
}

.btn-all {
    background: #2c3e50;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .2);
    padding: 11px 28px;
    border-radius: 60px;
    font-size: 1.15rem;
    box-shadow: 0 8px 16px -5px rgba(44, 62, 80, .3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: .2s;
    letter-spacing: 2px
}

.btn-all:hover {
    background: #1a2a3a;
    transform: scale(1.02);
    box-shadow: 0 12px 20px -6px #1e2b3c80
}

.btn-all:active {
    transform: scale(.98)
}

.lottery-row,
.multi-row,
.verify-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.card {
    background: #fafcfd;
    border-radius: 28px;
    padding: 20px 16px 22px;
    box-shadow: inset 0 1px 2px #fff, 0 6px 16px -6px rgba(0, 20, 40, .1);
    border: 1px solid rgba(210, 220, 235, .6);
    transition: transform .15s
}

.card:hover {
    transform: translateY(-2px)
}

.card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 4px;
    flex-wrap: wrap;
    gap: 6px
}

.card-header h2 {
    font-weight: 700;
    font-size: 1.55rem;
    color: #1a2e3f;
    display: flex;
    align-items: center;
    gap: 6px
}

.badge {
    background: #cfdde9;
    padding: 3px 10px;
    border-radius: 30px;
    font-size: .78rem;
    font-weight: 500;
    color: #1e3b4f
}

.section-label {
    font-weight: 600;
    color: #3a546d;
    margin-bottom: 8px;
    margin-top: 6px;
    padding-left: 4px;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 8px
}

.ball-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 6px;
    min-height: 56px
}

.ball,
.btn-lottery {
    transition: .1s;
    display: inline-flex;
    align-items: center
}

.ball {
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, .12), inset 0 2px 3px rgba(255, 255, 255, .5);
    border: 1px solid rgba(255, 255, 255, .6)
}

.ball-dlt-front {
    background: radial-gradient(circle at 30% 28%, #ff9f7c, #e1552e);
    background-color: #e1552e;
    box-shadow: 0 5px 0 #a3361c, 0 6px 10px rgba(0, 0, 0, .1), inset 0 2px 6px #ffe0d0
}

.ball-dlt-back {
    background: radial-gradient(circle at 30% 28%, #6ec4ff, #1a73e8);
    background-color: #1a73e8;
    box-shadow: 0 5px 0 #0f4a9e, 0 6px 10px rgba(0, 0, 0, .1), inset 0 2px 6px #c6e2ff
}

.ball-ssq-red {
    background: radial-gradient(circle at 30% 28%, #ff6b6b, #c92a2a);
    background-color: #c92a2a;
    box-shadow: 0 5px 0 #941c1c, 0 6px 10px rgba(0, 0, 0, .1), inset 0 2px 6px #ffc9c9
}

.ball-ssq-blue {
    background: radial-gradient(circle at 30% 28%, #74c0ff, #0d6efd);
    background-color: #0d6efd;
    box-shadow: 0 5px 0 #0a4da0, 0 6px 10px rgba(0, 0, 0, .1), inset 0 2px 6px #b6d9ff
}

.btn-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 18px;
    gap: 8px;
    flex-wrap: wrap
}

.btn-lottery {
    background: #ffffffec;
    border: 1.5px solid #b6c8d9;
    color: #1e3b4f;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 5px 0 #b0c2d0, 0 3px 6px rgba(0, 0, 0, .05);
    cursor: pointer;
    backdrop-filter: blur(5px);
    min-width: 110px;
    justify-content: center;
    gap: 5px;
    letter-spacing: 1.2px
}

.btn-copy,
.btn-save {
    background: #ffffffec;
    padding: 9px 14px;
    font-size: .88rem;
    transition: .1s;
    align-items: center;
    gap: 4px;
    letter-spacing: 1px;
    min-width: 80px;
    font-weight: 600;
    display: inline-flex;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(5px)
}

.btn-lottery:hover {
    background: #fff;
    border-color: #7d9bb3;
    box-shadow: 0 6px 0 #8da3b5, 0 5px 10px rgba(0, 0, 0, .08);
    transform: translateY(-1px)
}

.btn-lottery:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #8da3b5, 0 3px 6px rgba(0, 0, 0, .05)
}

.btn-copy {
    border: 1.5px solid #8ab4d8;
    color: #1a5276;
    border-radius: 50px;
    box-shadow: 0 4px 0 #7a9db8, 0 3px 6px rgba(0, 0, 0, .05);
    justify-content: center
}

.btn-copy:hover {
    background: #f0f7ff;
    border-color: #5c8ab5;
    box-shadow: 0 5px 0 #6a8faa, 0 5px 10px rgba(0, 0, 0, .07);
    transform: translateY(-1px)
}

.btn-copy:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #6a8faa, 0 2px 4px rgba(0, 0, 0, .04)
}

.btn-copy.copied {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
    box-shadow: 0 3px 0 #1e7e34, 0 2px 4px rgba(0, 0, 0, .04)
}

.btn-save {
    border: 1.5px solid #d4b896;
    color: #5c3d1e;
    border-radius: 50px;
    box-shadow: 0 4px 0 #c4a882, 0 3px 6px rgba(0, 0, 0, .05);
    justify-content: center
}

.btn-save:hover {
    background: #fffef9;
    border-color: #b8956a;
    box-shadow: 0 5px 0 #b8956a, 0 5px 10px rgba(0, 0, 0, .07);
    transform: translateY(-1px)
}

.btn-save:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #b8956a, 0 2px 4px rgba(0, 0, 0, .04)
}

.btn-save.saved {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    box-shadow: 0 3px 0 #d4a017, 0 2px 4px rgba(0, 0, 0, .04)
}

.btn-paste-sm {
    background: #f0f4f8;
    border: 1.5px solid #c8d6e0;
    color: #4a6278;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: .5px;
    white-space: nowrap;
    transition: .15s;
    flex-shrink: 0
}

.btn-paste-sm:hover {
    background: #fff;
    border-color: #8ab4d8;
    color: #1a5276
}

.btn-ai-copy-sm.copied,
.btn-paste-sm.pasted,
.btn-paste-sm:active {
    background: #d4edda;
    border-color: #28a745;
    color: #155724
}

.ai-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-width: 0
}

.ai-card {
    background: #fafcfd;
    border-radius: 24px;
    padding: 18px 16px 20px;
    box-shadow: inset 0 1px 2px #fff, 0 6px 16px -6px rgba(0, 20, 40, .1);
    border: 1px solid rgba(210, 220, 235, .6);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    overflow-x: auto
}

.ai-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px
}

.ai-card-header h3 {
    font-weight: 700;
    font-size: 1.2rem;
    color: #1a2e3f;
    display: flex;
    align-items: center;
    gap: 5px
}

.ai-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid #d0dde8;
    border-radius: 14px;
    padding: 10px 12px;
    font-family: 'SF Mono', Consolas, 'PingFang SC', monospace;
    font-size: .8rem;
    font-weight: 500;
    color: #1e3b4f;
    background: #fdfefe;
    resize: vertical;
    outline: 0;
    transition: border-color .2s;
    line-height: 1.6;
    letter-spacing: .4px
}

.ai-textarea:focus {
    border-color: #7b5ea7;
    box-shadow: 0 0 0 3px rgba(123, 94, 167, .1)
}

.ai-textarea::placeholder {
    color: #a0b4c4;
    font-weight: 400;
    letter-spacing: .3px
}

.ai-input-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center
}

.btn-ai-analyze {
    background: linear-gradient(135deg, #5b3e96, #7b5ea7);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 0 4px 0 #3e2868, 0 5px 12px rgba(91, 62, 150, .3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
    transition: .15s;
    white-space: nowrap
}

.btn-ai-analyze:hover {
    background: linear-gradient(135deg, #4a3080, #6b4e98);
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #3e2868, 0 7px 16px rgba(91, 62, 150, .35)
}

.btn-ai-analyze:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #3e2868, 0 3px 8px rgba(91, 62, 150, .2)
}

.ai-result-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px
}

.ai-stats-block {
    background: #f8fafd;
    border-radius: 14px;
    padding: 10px 14px;
    border: 1px solid rgba(190, 205, 220, .4);
    font-size: .75rem;
    color: #4a6278;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
    max-width: 100%;
    overflow-x: auto
}

.ai-stats-block .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap
}

.ai-stats-block .stat-label {
    font-weight: 600;
    color: #3a546d;
    font-size: .7rem
}

.ai-stats-block .stat-value {
    font-weight: 700;
    color: #1e2b3c
}

.ai-stats-block .stat-hot {
    color: #c0392b;
    font-weight: 700
}

.ai-stats-block .stat-warm {
    color: #e67e22;
    font-weight: 700
}

.ai-stats-block .stat-cold {
    color: #2980b9;
    font-weight: 700
}

.ai-freq-bar-wrap {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 40px;
    padding: 2px 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-width: 100%;
    max-width: 100%
}

.ai-freq-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
    min-width: 16px
}

.ai-freq-bar {
    width: 12px;
    border-radius: 3px 3px 0 0;
    background: #c8d6e0;
    transition: height .3s;
    min-height: 2px
}

.ai-freq-bar.hot {
    background: #e1552e
}

.ai-freq-bar.warm {
    background: #f0a030
}

.ai-freq-bar.cold {
    background: #7eb8da
}

.ai-freq-label {
    font-size: .45rem;
    color: #5e7a90;
    font-weight: 600
}

.ai-reco-block {
    background: #fffdf7;
    border-radius: 14px;
    padding: 12px 14px;
    border: 1.5px solid #e0d4b0
}

.ai-reco-block h4 {
    font-size: .85rem;
    color: #5c3d1e;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px
}

.ai-reco-ticket {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(200, 185, 150, .4);
    margin-bottom: 4px;
    flex-wrap: wrap;
    transition: background .12s
}

.ai-reco-ticket:hover {
    background: #fffef9
}

.ai-reco-label {
    font-weight: 700;
    font-size: .7rem;
    color: #7a5d30;
    min-width: 50px;
    flex-shrink: 0;
    letter-spacing: .5px
}

.ai-reco-tag,
.btn-ai-copy-sm {
    padding: 2px 7px;
    font-weight: 600
}

.ai-reco-balls-row {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap
}

.ai-reco-tag {
    display: inline-block;
    font-size: .6rem;
    border-radius: 10px;
    letter-spacing: .4px;
    flex-shrink: 0;
    margin-left: 2px
}

.ai-reco-tag.steady {
    background: #d4edda;
    color: #2d5a27
}

.ai-reco-tag.balanced {
    background: #d6ecfa;
    color: #1a5276
}

.ai-reco-tag.coldpick {
    background: #fde8d0;
    color: #a34d1a
}

.btn-ai-copy-sm {
    background: 0 0;
    border: 1px solid #d0dde8;
    color: #5e7a90;
    border-radius: 12px;
    font-size: .65rem;
    cursor: pointer;
    letter-spacing: .3px;
    transition: .12s;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 4px
}

.btn-ai-copy-sm:hover,
.btn-saved-action:hover {
    background: #f0f4f8;
    border-color: #a0b8cc;
    color: #1e3b4f
}

.ai-placeholder {
    color: #a0b4c4;
    font-size: .8rem;
    padding: 16px;
    letter-spacing: 1px
}

.ai-error-msg {
    color: #c0392b;
    font-size: .78rem;
    padding: 6px 10px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #f5c6cb
}

.ai-info-tip {
    font-size: .7rem;
    color: #8a9ca8;
    padding: 4px 8px;
    background: #f8fafd;
    border-radius: 6px;
    line-height: 1.4
}

.ball-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    box-shadow: 0 2px 3px rgba(0, 0, 0, .1), inset 0 1px 2px rgba(255, 255, 255, .4);
    border: 1px solid rgba(255, 255, 255, .5);
    flex-shrink: 0
}

.ball-sm.ball-dlt-front {
    background: radial-gradient(circle at 30% 28%, #ff9f7c, #e1552e);
    background-color: #e1552e;
    box-shadow: 0 3px 0 #a3361c, 0 4px 6px rgba(0, 0, 0, .08), inset 0 1px 4px #ffe0d0
}

.ball-sm.ball-dlt-back {
    background: radial-gradient(circle at 30% 28%, #6ec4ff, #1a73e8);
    background-color: #1a73e8;
    box-shadow: 0 3px 0 #0f4a9e, 0 4px 6px rgba(0, 0, 0, .08), inset 0 1px 4px #c6e2ff
}

.ball-sm.ball-ssq-red {
    background: radial-gradient(circle at 30% 28%, #ff6b6b, #c92a2a);
    background-color: #c92a2a;
    box-shadow: 0 3px 0 #941c1c, 0 4px 6px rgba(0, 0, 0, .08), inset 0 1px 4px #ffc9c9
}

.ball-sm.ball-ssq-blue {
    background: radial-gradient(circle at 30% 28%, #74c0ff, #0d6efd);
    background-color: #0d6efd;
    box-shadow: 0 3px 0 #0a4da0, 0 4px 6px rgba(0, 0, 0, .08), inset 0 1px 4px #b6d9ff
}

.saved-section {
    flex-shrink: 0;
    margin-top: 6px;
    background: rgba(248, 250, 252, .8);
    border-radius: 18px;
    border: 1px solid rgba(180, 200, 220, .4);
    overflow: hidden
}

.saved-section summary {
    padding: 12px 18px;
    font-weight: 700;
    font-size: .85rem;
    color: #3a546d;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px
}

.saved-section summary::-webkit-details-marker {
    display: none
}

.saved-section summary::after {
    content: ' ▸';
    display: inline-block;
    transition: transform .2s;
    margin-left: auto;
    font-size: .9rem
}

.disclaimer-note[open] summary::after,
.saved-section[open] summary::after {
    transform: rotate(90deg)
}

.saved-section .saved-count {
    font-size: .7rem;
    background: #cfdde9;
    padding: 2px 10px;
    border-radius: 20px;
    color: #1e3b4f;
    font-weight: 500
}

.saved-content {
    padding: 6px 14px 14px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.saved-content::-webkit-scrollbar {
    width: 4px
}

.saved-content::-webkit-scrollbar-thumb {
    background: #c8d6e0;
    border-radius: 8px
}

.saved-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(200, 215, 230, .35);
    flex-wrap: wrap;
    transition: background .12s
}

.btn-saved-action,
.saved-item-type {
    padding: 3px 8px;
    white-space: nowrap
}

.multi-ticket-row:hover,
.saved-item:hover {
    background: #f8fafd
}

.saved-item-type {
    font-weight: 700;
    font-size: .7rem;
    border-radius: 12px;
    flex-shrink: 0
}

.saved-item-type.dlt {
    background: #ffe8d6;
    color: #a34d1a
}

.saved-item-type.ssq {
    background: #ffe0e0;
    color: #a32020
}

.saved-item-nums {
    font-size: .8rem;
    font-weight: 600;
    color: #1e2b3c;
    letter-spacing: .5px;
    flex: 1;
    min-width: 120px
}

.saved-item-time {
    font-size: .65rem;
    color: #8a9ca8;
    white-space: nowrap;
    flex-shrink: 0
}

.saved-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0
}

.btn-saved-action {
    background: 0 0;
    border: 1px solid #d0dde8;
    color: #5e7a90;
    border-radius: 14px;
    font-size: .68rem;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: .4px;
    transition: .12s
}

.btn-clear-saved:hover,
.btn-saved-action.danger:hover {
    background: #fff5f5;
    border-color: #e05555;
    color: #c0392b
}

.saved-empty {
    color: #a0b4c4;
    font-size: .78rem;
    padding: 14px;
    letter-spacing: 1px
}

.btn-clear-saved,
.count-btn {
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .5px
}

.btn-clear-saved {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    color: #6c757d;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: .7rem;
    align-self: flex-end;
    transition: .12s
}

.multi-action-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap
}

.multi-sub-card,
.verify-sub-card {
    background: #fafbfd;
    border-radius: 20px;
    padding: 16px 14px 18px;
    border: 1px solid rgba(180, 200, 220, .3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .03);
    display: flex;
    flex-direction: column
}

.multi-sub-header,
.verify-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px
}

.multi-sub-header h3,
.verify-sub-header h3 {
    font-weight: 700;
    font-size: 1.15rem;
    color: #1e3b4f;
    display: flex;
    align-items: center;
    gap: 5px
}

.count-selector {
    display: flex;
    gap: 3px;
    background: #e9eef4;
    border-radius: 24px;
    padding: 2px
}

.count-btn {
    border: none;
    background: 0 0;
    color: #546e7a;
    font-size: .82rem;
    padding: 5px 12px;
    border-radius: 22px;
    transition: .18s;
    white-space: nowrap
}

.count-btn:hover,
.modal-type-btn:hover {
    color: #1e3b4f;
    background: rgba(255, 255, 255, .55)
}

.count-btn.active {
    background: #fff;
    color: #1a2e3f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
    font-weight: 700
}

.multi-result-area {
    flex: 1;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 2px
}

.multi-result-placeholder {
    color: #a0b4c4;
    font-size: .85rem;
    padding: 20px 8px;
    letter-spacing: 1px
}

.multi-ticket-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(190, 205, 220, .4);
    flex-wrap: wrap;
    transition: background .12s
}

.ticket-label {
    font-weight: 700;
    font-size: .75rem;
    color: #5e7a90;
    min-width: 30px;
    letter-spacing: .5px;
    flex-shrink: 0
}

.ticket-balls-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap
}

.btn-all-multi,
.btn-multi {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-weight: 600
}

.btn-multi {
    background: #ffffffec;
    border: 1.5px solid #c4b89a;
    color: #4a3720;
    padding: 8px 14px;
    border-radius: 40px;
    font-size: .9rem;
    box-shadow: 0 3px 0 #bfb090, 0 2px 4px rgba(0, 0, 0, .05);
    backdrop-filter: blur(5px);
    transition: .1s;
    gap: 4px;
    letter-spacing: 1px;
    white-space: nowrap
}

.btn-multi:hover {
    background: #fffef9;
    border-color: #b09e78;
    box-shadow: 0 4px 0 #a89870, 0 4px 8px rgba(0, 0, 0, .07);
    transform: translateY(-1px)
}

.btn-multi:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #a89870, 0 2px 4px rgba(0, 0, 0, .04)
}

.btn-all-multi {
    background: #3d2e1c;
    color: #f5e8d3;
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 10px 22px;
    border-radius: 40px;
    font-size: .95rem;
    box-shadow: 0 5px 0 #2b1e10, 0 6px 12px rgba(40, 20, 5, .2);
    gap: 6px;
    letter-spacing: 1.3px;
    transition: .15s
}

.btn-verify,
.btn-verify-clear {
    transition: .1s;
    white-space: nowrap
}

.btn-all-multi:hover {
    background: #4f3b26;
    transform: scale(1.02);
    box-shadow: 0 6px 0 #2b1e10, 0 8px 16px rgba(40, 20, 5, .25)
}

.btn-all-multi:active {
    transform: scale(.97);
    box-shadow: 0 2px 0 #2b1e10, 0 4px 8px rgba(40, 20, 5, .18)
}

.verify-input-group {
    margin-bottom: 8px
}

.verify-input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #4a6278;
    font-size: .8rem;
    margin-bottom: 4px;
    letter-spacing: .5px;
    flex-wrap: wrap
}

.verify-input-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center
}

.verify-input-row input {
    width: 36px;
    height: 34px;
    border: 2px solid #d0dde8;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 700;
    color: #1e3b4f;
    background: #fff;
    transition: .15s
}

.modal-input-row input:focus,
.verify-input-row input:focus {
    border-color: #6ca0d0;
    box-shadow: 0 0 0 3px rgba(108, 160, 208, .15)
}

.modal-input-row input.input-error,
.verify-input-row input.input-error {
    border-color: #e05555;
    background: #fff5f5
}

.modal-input-separator,
.verify-input-separator {
    font-weight: 700;
    color: #5e7e9c;
    font-size: 1rem;
    margin: 0 2px;
    flex-shrink: 0
}

.modal-input-label-sm,
.verify-input-label-sm {
    font-size: .7rem;
    color: #7a8fa0;
    font-weight: 600;
    flex-shrink: 0;
    margin: 0 1px
}

.verify-result-area {
    margin-top: 8px;
    min-height: 36px;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.btn-verify,
.verify-result-badge {
    align-items: center;
    display: inline-flex
}

.verify-result-badge {
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .8px;
    flex-wrap: wrap
}

.btn-verify,
.btn-verify-clear,
.modal-type-btn,
.multiplier-row label,
.rules-hint summary {
    font-weight: 600;
    cursor: pointer
}

.verify-result-badge.win-big {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107
}

.verify-result-badge.win-small {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745
}

.verify-result-badge.no-win {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #ced4da
}

.verify-result-detail {
    font-size: .75rem;
    color: #5e7a90;
    padding: 0 4px;
    line-height: 1.4
}

.btn-verify {
    background: #ffffffec;
    border: 1.5px solid #8bc48b;
    color: #2d5a27;
    padding: 8px 14px;
    border-radius: 40px;
    font-size: .85rem;
    box-shadow: 0 3px 0 #7ab07a, 0 2px 4px rgba(0, 0, 0, .05);
    backdrop-filter: blur(5px);
    gap: 4px;
    letter-spacing: 1px;
    margin-top: 8px
}

.btn-verify:hover {
    background: #fffef9;
    border-color: #6aa06a;
    box-shadow: 0 4px 0 #6a9e6a, 0 4px 8px rgba(0, 0, 0, .07);
    transform: translateY(-1px)
}

.btn-verify:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #6a9e6a, 0 2px 4px rgba(0, 0, 0, .04)
}

.btn-verify-clear {
    background: #f8f9fa;
    border: 1.5px solid #ced4da;
    color: #6c757d;
    padding: 6px 10px;
    border-radius: 40px;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    gap: 3px
}

.btn-modal-cancel:hover,
.btn-verify-clear:hover {
    background: #fff;
    border-color: #adb5bd
}

.btn-verify-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 2px
}

.rules-hint {
    font-size: .7rem;
    color: #8a9ca8;
    margin-top: 4px;
    padding: 3px 6px;
    background: #f8fafd;
    border-radius: 6px;
    line-height: 1.4
}

.rules-hint summary {
    color: #5e7a90;
    font-size: .72rem
}

.multiplier-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 4px 0 2px
}

.multiplier-row input[type=number] {
    width: 48px;
    height: 30px;
    border: 2px solid #d0dde8;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: .85rem;
    background: #fff;
    outline: 0
}

.multiplier-row input[type=number]:focus {
    border-color: #6ca0d0
}

.multiplier-row label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #4a6278;
    font-size: .78rem;
    margin-bottom: 0
}

.multiplier-row input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: #2c5a2c
}

.footer-note {
    margin-top: 4px;
    color: #5e7a90;
    font-size: .72rem;
    opacity: .65;
    letter-spacing: .4px;
    flex-shrink: 0;
    line-height: 1.4
}

.footer-note-tip {
    font-size: .7rem;
    opacity: .55;
    margin-top: 2px
}

.official-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    font-size: .8rem;
    color: #2c5a2c;
    text-decoration: none;
    border-bottom: 1px dashed
}

.official-link:hover {
    color: #1a3a1a
}

.disclaimer-note {
    margin-top: 6px;
    background: rgba(255, 245, 230, .6);
    border-radius: 16px;
    font-size: .75rem;
    color: #8a7a60;
    border: 1px solid rgba(200, 180, 140, .3);
    flex-shrink: 0
}

.disclaimer-note summary {
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-size: .78rem
}

.disclaimer-note summary::-webkit-details-marker {
    display: none
}

.disclaimer-note summary::after {
    content: ' ▸';
    display: inline-block;
    transition: transform .2s;
    margin-left: 6px;
    font-size: .9rem
}

.disclaimer-note .disclaimer-content {
    padding: 0 16px 12px;
    line-height: 1.6
}

@media (max-width:720px) {
    body {
        padding: 6px
    }

    .system-container {
        padding: 10px 8px 8px;
        border-radius: 22px;
        max-height: 100vh;
        max-height: 100dvh
    }

    h1 {
        font-size: 1.25rem;
        gap: 4px;
        margin-bottom: 1px;
        letter-spacing: 1px
    }

    h1 span {
        font-size: .65rem;
        padding: 2px 8px
    }

    .subhead {
        font-size: .68rem;
        margin-bottom: 4px;
        padding-bottom: 5px;
        letter-spacing: 0;
        line-height: 1.2
    }

    .tab-btn {
        padding: 8px 4px 10px;
        font-size: .65rem;
        gap: 2px;
        border-radius: 12px 12px 0 0;
        letter-spacing: 0
    }

    .tab-btn .tab-icon {
        font-size: .8rem
    }

    .tab-btn .tab-badge {
        font-size: .5rem;
        padding: 1px 4px;
        letter-spacing: 0
    }

    .tab-btn.active {
        padding-bottom: 11px
    }

    .tabs-panels {
        padding: 10px 0 8px;
        border-radius: 0 0 16px 16px
    }

    .tab-panel {
        padding: 6px 6px 10px
    }

    .ai-row,
    .lottery-row,
    .multi-row,
    .verify-row {
        grid-template-columns: 1fr;
        gap: 8px
    }

    .card {
        padding: 12px 10px 14px;
        border-radius: 18px
    }

    .action-bar,
    .card-header {
        margin-bottom: 8px
    }

    .card-header h2 {
        font-size: 1.15rem
    }

    .ball {
        width: 38px;
        height: 38px;
        font-size: 1.1rem
    }

    .ball-container {
        gap: 5px 6px;
        min-height: 40px;
        margin-bottom: 2px
    }

    .section-label {
        font-size: .78rem;
        margin-bottom: 4px;
        margin-top: 3px
    }

    .btn-group {
        margin-top: 8px;
        gap: 4px
    }

    .btn-copy,
    .btn-lottery,
    .btn-save {
        padding: 6px 10px;
        font-size: .72rem;
        min-width: 55px;
        letter-spacing: .4px;
        border-radius: 30px
    }

    .btn-all {
        padding: 8px 18px;
        font-size: .9rem;
        letter-spacing: 1px
    }

    .btn-paste-sm {
        padding: 3px 6px;
        font-size: .6rem;
        border-radius: 14px
    }

    .ai-card,
    .multi-sub-card,
    .verify-sub-card {
        padding: 10px 8px 12px
    }

    .ai-card-header h3,
    .multi-sub-header h3,
    .verify-sub-header h3 {
        font-size: .95rem
    }

    .multi-action-top {
        margin-bottom: 10px;
        gap: 6px
    }

    .verify-input-row input {
        width: 30px;
        height: 28px;
        font-size: .72rem;
        border-radius: 7px
    }

    .ai-card {
        gap: 6px
    }

    .ai-textarea {
        min-height: 70px;
        font-size: .65rem;
        padding: 6px 8px;
        border-radius: 10px
    }

    .ai-stats-block {
        font-size: .62rem;
        gap: 2px 6px;
        padding: 6px 8px
    }

    .ai-stats-block .stat-label {
        font-size: .6rem
    }

    .ai-info-tip,
    .btn-saved-action,
    .saved-item-type {
        font-size: .6rem;
        padding: 2px 5px
    }

    .ai-reco-block {
        padding: 8px 10px
    }

    .ai-reco-block h4 {
        font-size: .72rem;
        margin-bottom: 4px
    }

    .ai-reco-ticket {
        padding: 4px 6px;
        gap: 3px
    }

    .ai-reco-label {
        font-size: .6rem;
        min-width: 35px
    }

    .ai-freq-bar {
        width: 7px
    }

    .ai-freq-bar-col {
        min-width: 10px
    }

    .ai-freq-label {
        font-size: .35rem
    }

    .ball-sm,
    .saved-section summary::after {
        font-size: .7rem
    }

    .ai-freq-bar-wrap {
        height: 30px
    }

    .ball-sm {
        width: 24px;
        height: 24px
    }

    .footer-note {
        font-size: .58rem;
        margin-top: 2px;
        letter-spacing: .1px;
        line-height: 1.25;
        opacity: .6;
        padding: 0 4px
    }

    .footer-note-tip {
        display: none
    }

    .saved-section {
        margin-top: 3px;
        border-radius: 12px
    }

    .saved-section summary {
        padding: 7px 10px;
        font-size: .7rem;
        gap: 4px;
        letter-spacing: .3px
    }

    .saved-section .saved-count {
        font-size: .6rem;
        padding: 1px 6px
    }

    .saved-content {
        padding: 4px 8px 8px;
        max-height: 120px;
        gap: 4px
    }

    .saved-item {
        gap: 3px;
        padding: 5px 6px;
        border-radius: 8px
    }

    .saved-item-nums {
        font-size: .65rem;
        min-width: 60px;
        letter-spacing: 0
    }

    .saved-item-time {
        font-size: .55rem
    }

    .disclaimer-note {
        margin-top: 3px;
        border-radius: 10px;
        font-size: .6rem
    }

    .disclaimer-note summary {
        padding: 7px 10px;
        font-size: .65rem
    }

    .disclaimer-note summary::after,
    .multiplier-row label,
    .verify-result-detail {
        font-size: .65rem
    }

    .disclaimer-note .disclaimer-content {
        padding: 0 8px 8px;
        line-height: 1.4;
        font-size: .58rem
    }

    .official-link {
        font-size: .6rem;
        margin-left: 4px
    }

    .btn-clear-saved {
        font-size: .6rem;
        padding: 3px 8px
    }

    .rules-hint {
        font-size: .6rem;
        padding: 2px 4px
    }

    .rules-hint summary {
        font-size: .62rem
    }

    .verify-result-badge {
        font-size: .7rem;
        padding: 5px 10px
    }

    .btn-all-multi,
    .btn-multi,
    .btn-verify {
        font-size: .72rem;
        padding: 6px 10px
    }

    .btn-verify-clear {
        font-size: .65rem;
        padding: 4px 7px
    }

    .count-btn {
        font-size: .65rem;
        padding: 3px 8px
    }

    .splash-screen::before {
        width: 220px;
        height: 220px
    }

    .splash-screen::after {
        width: 150px;
        height: 150px
    }

    .splash-balls-row {
        gap: clamp(3px, 1vw, 6px)
    }

    .splash-title {
        letter-spacing: 2px
    }

    .modal-dialog {
        padding: 16px 12px 14px;
        border-radius: 18px;
        gap: 10px
    }

    .modal-header h3 {
        font-size: 1rem
    }

    .modal-type-btn {
        font-size: .72rem;
        padding: 8px 10px
    }

    .modal-input-row input {
        width: 34px;
        height: 30px;
        font-size: .75rem
    }

    .btn-modal-cancel,
    .btn-modal-save {
        padding: 7px 14px;
        font-size: .75rem
    }

    .my-bet-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 4px 6px
    }

    .line-label {
        min-width: auto;
        font-size: .65rem
    }
}

.modal-header,
.modal-overlay {
    align-items: center;
    display: flex
}

@media (max-width:400px) {
    body {
        padding: 2px
    }

    .system-container {
        padding: 6px 4px 4px;
        border-radius: 16px
    }

    h1 {
        font-size: 1.05rem;
        gap: 3px;
        letter-spacing: .5px
    }

    h1 span {
        font-size: .55rem;
        padding: 1px 6px
    }

    .subhead {
        font-size: .58rem;
        margin-bottom: 2px;
        padding-bottom: 3px
    }

    .tab-btn {
        padding: 6px 2px 8px;
        font-size: .56rem;
        gap: 1px;
        border-radius: 10px 10px 0 0
    }

    .tab-btn .tab-icon {
        font-size: .7rem
    }

    .tab-btn .tab-badge {
        display: none
    }

    .tab-btn.active {
        padding-bottom: 9px
    }

    .tabs-panels {
        padding: 6px 0 4px;
        border-radius: 0 0 12px 12px
    }

    .tab-panel {
        padding: 4px 3px 6px
    }

    .card {
        padding: 8px 6px 10px;
        border-radius: 14px
    }

    .card-header h2 {
        font-size: .95rem
    }

    .ball {
        width: 30px;
        height: 30px;
        font-size: .9rem
    }

    .ball-container {
        gap: 3px 4px;
        min-height: 32px
    }

    .section-label {
        font-size: .68rem;
        margin-bottom: 2px;
        margin-top: 2px;
        gap: 4px
    }

    .btn-group {
        margin-top: 5px;
        gap: 3px
    }

    .btn-copy,
    .btn-lottery,
    .btn-save {
        padding: 4px 7px;
        font-size: .65rem;
        min-width: 44px;
        letter-spacing: .2px;
        border-radius: 22px
    }

    .btn-all {
        padding: 5px 12px;
        font-size: .72rem;
        letter-spacing: .5px;
        border-radius: 30px
    }

    .btn-paste-sm {
        padding: 2px 4px;
        font-size: .55rem
    }

    .ball-sm {
        width: 20px;
        height: 20px;
        font-size: .6rem
    }

    .ai-textarea {
        min-height: 55px;
        font-size: .58rem;
        padding: 4px 6px
    }

    .ai-stats-block {
        font-size: .55rem;
        gap: 1px 4px;
        padding: 4px 6px
    }

    .ai-reco-label {
        font-size: .55rem;
        min-width: 28px
    }

    .ai-reco-tag {
        font-size: .5rem;
        padding: 1px 4px
    }

    .btn-ai-analyze {
        font-size: .68rem;
        padding: 6px 10px
    }

    .btn-ai-copy-sm {
        font-size: .55rem;
        padding: 1px 4px
    }

    .footer-note {
        font-size: .5rem;
        margin-top: 1px;
        line-height: 1.2
    }

    .saved-section summary {
        padding: 5px 8px;
        font-size: .62rem
    }

    .saved-content {
        max-height: 80px;
        padding: 2px 5px 5px
    }

    .saved-item-nums {
        font-size: .58rem;
        min-width: 40px
    }

    .disclaimer-note summary {
        padding: 5px 8px;
        font-size: .58rem
    }

    .disclaimer-note .disclaimer-content {
        font-size: .5rem;
        padding: 0 5px 5px
    }

    .verify-input-row input {
        width: 25px;
        height: 24px;
        font-size: .6rem
    }

    .splash-screen::before {
        width: 160px;
        height: 160px
    }

    .splash-screen::after {
        width: 110px;
        height: 110px
    }

    .splash-title {
        letter-spacing: 1px
    }

    .splash-balls-row {
        gap: 2px
    }

    .modal-dialog {
        padding: 12px 8px 10px;
        border-radius: 14px;
        gap: 8px
    }

    .modal-input-row input {
        width: 28px;
        height: 26px;
        font-size: .68rem
    }

    .modal-type-btn {
        font-size: .65rem;
        padding: 6px 8px
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .65);
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto
}

.modal-dialog {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 48px rgba(0, 10, 30, .25);
    padding: 24px 20px 20px;
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateY(12px);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1)
}

.modal-header {
    justify-content: space-between;
    gap: 10px
}

.modal-header h3 {
    font-weight: 700;
    font-size: 1.15rem;
    color: #1a2e3f;
    display: flex;
    align-items: center;
    gap: 6px
}

.modal-close-btn {
    background: 0 0;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #8a9ca8;
    padding: 4px 8px;
    border-radius: 8px;
    transition: .15s
}

.modal-close-btn:hover {
    background: #f0f4f8;
    color: #1e2b3c
}

.modal-type-selector {
    display: flex;
    gap: 8px;
    background: #e9eef4;
    border-radius: 12px;
    padding: 4px
}

.modal-type-btn {
    flex: 1;
    border: none;
    background: 0 0;
    color: #546e7a;
    font-size: .85rem;
    padding: 10px 14px;
    border-radius: 10px;
    transition: .18s;
    letter-spacing: .5px;
    white-space: nowrap
}

.btn-modal-cancel,
.btn-modal-save {
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
    transition: .15s
}

.modal-type-btn.active {
    background: #fff;
    color: #1a2e3f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    font-weight: 700
}

.modal-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px
}

.modal-input-group label {
    font-weight: 600;
    color: #4a6278;
    font-size: .8rem;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 6px
}

.modal-input-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center
}

.modal-input-row input {
    width: 42px;
    height: 38px;
    border: 2px solid #d0dde8;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 700;
    color: #1e3b4f;
    background: #fff;
    transition: .15s
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap
}

.btn-modal-cancel {
    background: #f8f9fa;
    border: 1.5px solid #ced4da;
    color: #6c757d;
    padding: 9px 18px;
    border-radius: 40px
}

.btn-modal-save {
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 40px;
    box-shadow: 0 4px 0 #1a2a3a, 0 4px 10px rgba(44, 62, 80, .25);
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.btn-modal-save:hover {
    background: #1a2a3a;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #0f1f2e, 0 6px 14px rgba(44, 62, 80, .3)
}

.btn-modal-save:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0f1f2e, 0 3px 6px rgba(44, 62, 80, .15)
}

.multi-bet-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 4px
}

.my-bet-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f6f8fc;
    border-radius: 12px;
    border: 1px solid rgba(180, 200, 220, .3)
}

.line-label {
    font-weight: 700;
    font-size: .75rem;
    color: #4a6278;
    min-width: 45px;
    white-space: nowrap
}

.my-bet-line .verify-input-row {
    flex: 1;
    margin: 0
}