.txm-game,
.txm-game * {
    box-sizing: border-box;
}

.txm-game {
    --txm-bg: #130d08;
    --txm-dark: #090604;
    --txm-brown: #2b1608;
    --txm-gold: #f9d98a;
    --txm-gold-2: #b6762b;
    --txm-gold-3: #fff4c5;
    --txm-red: #5c0715;
    --txm-red-2: #a51426;
    --txm-text: #fff8dd;
    max-width: 980px;
    margin: 28px auto;
    color: var(--txm-text);
    font-family: Arial, Helvetica, sans-serif;
    position: relative;
    isolation: isolate;
}

.txm-frame {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    padding: 16px 18px 18px;
    background:
        radial-gradient(circle at 50% -10%, rgba(255, 218, 140, .34), transparent 34%),
        radial-gradient(circle at 10% 30%, rgba(255, 190, 82, .18), transparent 28%),
        radial-gradient(circle at 90% 35%, rgba(255, 220, 150, .14), transparent 30%),
        linear-gradient(180deg, #24170e 0%, #0d0805 58%, #120a05 100%);
    border: 2px solid rgba(255, 229, 167, .45);
    box-shadow:
        0 18px 52px rgba(0, 0, 0, .52),
        inset 0 0 0 1px rgba(255, 255, 255, .07),
        inset 0 18px 36px rgba(255, 218, 145, .10);
}

.txm-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255,255,255,.09), transparent),
        repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0, rgba(255,255,255,.025) 1px, transparent 1px, transparent 36px);
    opacity: .55;
    pointer-events: none;
}

.txm-glow {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    filter: blur(36px);
    opacity: .42;
    z-index: -1;
}

.txm-glow-left {
    left: 4%;
    top: 10%;
    background: #c58537;
}

.txm-glow-right {
    right: 4%;
    top: 18%;
    background: #80511c;
}

.txm-topbar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 160px 1fr 220px;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.txm-user-pill {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(180deg, #17120d, #050403);
    color: rgba(255, 244, 198, .72);
    border: 1px solid rgba(255, 224, 160, .26);
    box-shadow: inset 0 0 16px rgba(0,0,0,.8), 0 0 14px rgba(244, 194, 99, .15);
    font-weight: 700;
    letter-spacing: .4px;
}

.txm-title-wrap {
    text-align: center;
    position: relative;
    padding-top: 2px;
}

.txm-title-wrap h2 {
    margin: 0;
    font-size: clamp(30px, 5vw, 58px);
    line-height: .88;
    color: #fff7d7;
    letter-spacing: 1px;
    text-shadow:
        0 2px 0 #3b1d07,
        0 0 10px rgba(255, 225, 146, .62),
        0 0 28px rgba(255, 175, 65, .35);
    font-weight: 900;
}

.txm-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    margin-top: 7px;
    padding: 6px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #351105, #150703);
    border: 1px solid rgba(255, 224, 160, .27);
    color: #f7e3b1;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(0,0,0,.42), inset 0 0 12px rgba(255,255,255,.07);
}

.txm-dice-icon,
.txm-coins {
    position: absolute;
    top: -6px;
    font-size: 32px;
    filter: drop-shadow(0 4px 7px rgba(0,0,0,.55));
}

.txm-dice-icon { left: 16%; }
.txm-coins { right: 14%; }

.txm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.txm-actions span,
.txm-mini-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 35% 25%, #fff0bd, #7c4a1d 42%, #160c05 78%);
    color: #fff3cf;
    border: 2px solid rgba(255, 244, 210, .65);
    box-shadow: 0 5px 12px rgba(0,0,0,.45), inset 0 0 12px rgba(255,255,255,.18);
    font-weight: 900;
}

.txm-board {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 260px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 30px;
    background:
        linear-gradient(90deg, rgba(255, 220, 154, .38), rgba(84, 47, 18, .86) 18%, rgba(19, 10, 4, .92) 50%, rgba(84, 47, 18, .86) 82%, rgba(255, 220, 154, .38)),
        linear-gradient(180deg, #966331, #1a0b04);
    border: 2px solid rgba(255, 234, 178, .72);
    box-shadow:
        inset 0 0 22px rgba(255, 224, 156, .20),
        inset 0 -18px 30px rgba(0,0,0,.35),
        0 14px 28px rgba(0,0,0,.42);
}

.txm-board::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 24px;
    border: 1px solid rgba(255, 248, 221, .12);
    pointer-events: none;
}

.txm-wing {
    min-width: 0;
    position: relative;
}

.txm-players {
    width: 86px;
    margin: 0 auto 6px;
    padding: 4px 10px;
    text-align: center;
    color: #fff5d5;
    background: linear-gradient(180deg, #351105, #140803);
    border: 1px solid rgba(255, 232, 171, .4);
    border-radius: 999px;
    font-weight: 800;
    box-shadow: inset 0 0 10px rgba(255,255,255,.06);
}

.txm-person {
    opacity: .85;
}

.txm-side {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    padding: 22px 18px 20px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 241, 194, .8), transparent 26%),
        linear-gradient(180deg, #f1dca8 0%, #8e5727 32%, #2f1407 78%, #110602 100%);
    border: 2px solid rgba(255, 236, 188, .76);
    text-align: center;
    box-shadow:
        inset 0 0 24px rgba(255, 244, 206, .23),
        inset 0 -25px 34px rgba(0,0,0,.52),
        0 9px 18px rgba(0,0,0,.38);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.txm-side::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 17px;
    border: 1px solid rgba(255, 255, 255, .12);
    pointer-events: none;
}

.txm-side.active {
    transform: translateY(-4px) scale(1.015);
    box-shadow:
        inset 0 0 28px rgba(255, 244, 206, .30),
        inset 0 -25px 34px rgba(0,0,0,.52),
        0 0 26px rgba(255, 213, 128, .72),
        0 9px 18px rgba(0,0,0,.38);
    filter: brightness(1.10);
}

.txm-side-name {
    margin-top: 8px;
    font-size: clamp(46px, 6vw, 76px);
    line-height: .9;
    color: #150905;
    text-shadow: 0 1px 0 rgba(255,255,255,.35), 0 0 10px rgba(255, 242, 200, .55);
    font-weight: 900;
    letter-spacing: 1px;
}

.txm-side-xiu .txm-side-name {
    color: #fff3cf;
    text-shadow: 0 2px 0 rgba(31, 13, 4, .7), 0 0 12px rgba(255, 242, 200, .42);
}

.txm-side-sub {
    margin: 8px 0 10px;
    color: rgba(255, 247, 221, .86);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.txm-pool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 172px;
    margin: 2px auto 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #9c1429, #430811);
    border: 1px solid rgba(255, 208, 155, .6);
    color: #fff8de;
    box-shadow: inset 0 0 12px rgba(255,255,255,.10), 0 5px 10px rgba(0,0,0,.38);
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 1px;
}

.txm-bet-side,
.txm-play-btn,
.txm-check-btn,
.txm-copy-btn,
.txm-chip {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.txm-bet-side {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 9px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff4c4, #b6782f 48%, #351204);
    color: #fff9db;
    text-shadow: 0 2px 2px rgba(0,0,0,.55);
    border: 1px solid rgba(255, 241, 198, .78);
    box-shadow: inset 0 0 8px rgba(255,255,255,.25), 0 7px 12px rgba(0,0,0,.42);
    font-weight: 900;
    font-size: 17px;
}

.txm-bet-side:hover,
.txm-play-btn:hover,
.txm-check-btn:hover,
.txm-copy-btn:hover,
.txm-chip:hover {
    filter: brightness(1.08);
}

.txm-center {
    position: relative;
    z-index: 2;
    min-height: 268px;
    padding: 7px 6px 0;
    text-align: center;
}

.txm-md5-small {
    width: 100%;
    margin-bottom: 7px;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .42);
    border: 1px solid rgba(255, 233, 169, .23);
    font-size: 11px;
    color: rgba(255, 248, 224, .78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.txm-md5-small strong {
    color: #ffe5a2;
}

.txm-timer-ring {
    width: 178px;
    height: 178px;
    margin: 0 auto 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle, #1a0903 0%, #080302 58%, #4a2a12 61%, #f3d490 69%, #593014 78%, #0d0502 100%);
    border: 3px solid rgba(255, 237, 189, .55);
    box-shadow:
        inset 0 0 26px rgba(0,0,0,.95),
        0 0 0 5px rgba(27, 14, 5, .92),
        0 0 28px rgba(255, 207, 126, .22);
}

.txm-timer {
    font-size: 62px;
    line-height: 1;
    color: #fff6cf;
    text-shadow: 0 2px 0 rgba(0,0,0,.9), 0 0 12px rgba(255, 232, 169, .65);
    font-weight: 900;
}

.txm-dice-area {
    min-height: 38px;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: -1px 0 8px;
}

.txm-dice {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(180deg, #fffdf2, #e0bc77);
    color: #231005;
    font-size: 23px;
    font-weight: 900;
    box-shadow: inset 0 0 7px rgba(255,255,255,.5), 0 4px 8px rgba(0,0,0,.36);
}

.txm-dice.txm-rolling {
    animation: txmShake .42s linear infinite;
}

@keyframes txmShake {
    0% { transform: rotate(0) translateY(0); }
    25% { transform: rotate(12deg) translateY(-3px); }
    50% { transform: rotate(-12deg) translateY(3px); }
    75% { transform: rotate(8deg) translateY(-2px); }
    100% { transform: rotate(0) translateY(0); }
}

.txm-status {
    min-height: 22px;
    margin-bottom: 8px;
    color: #ffe3a3;
    font-weight: 800;
    font-size: 13px;
}

.txm-bet-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.txm-chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff1b6, #b8732d);
    color: #2a1204;
    font-weight: 900;
    box-shadow: 0 4px 8px rgba(0,0,0,.30);
}

.txm-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin: 0 auto 8px;
    max-width: 246px;
}

.txm-bet-input {
    width: 100%;
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 230, 163, .35);
    background: rgba(0,0,0,.45);
    color: #fff4ca;
    padding: 0 14px;
    outline: 0;
    font-size: 15px;
    font-weight: 900;
}

.txm-play-btn {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff4c4, #d49238 48%, #5b2408);
    color: #fff8da;
    text-shadow: 0 2px 2px rgba(0,0,0,.6);
    font-weight: 900;
    box-shadow: inset 0 0 9px rgba(255,255,255,.28), 0 7px 13px rgba(0,0,0,.42);
}

.txm-play-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.txm-balance {
    color: rgba(255, 248, 224, .76);
    font-size: 13px;
}

.txm-balance strong {
    color: #ffe08b;
}

.txm-history-bar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    gap: 10px;
    align-items: center;
    padding: 10px 8px 0;
}

.txm-history-list {
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,.32);
    border: 1px solid rgba(255, 230, 160, .16);
}

.txm-dot {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,.34);
    box-shadow: inset 0 0 4px rgba(255,255,255,.35), 0 3px 6px rgba(0,0,0,.32);
    font-size: 10px;
    font-weight: 900;
}

.txm-dot.tai {
    background: #f6e5ba;
    color: #160804;
}

.txm-dot.xiu {
    background: #080604;
    color: #fff0be;
}

.txm-md5-panel,
.txm-log-panel {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 232, 169, .20);
    background: rgba(5, 3, 2, .56);
    box-shadow: inset 0 0 18px rgba(255, 219, 139, .06);
}

.txm-md5-panel {
    padding: 15px;
}

.txm-md5-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.txm-md5-head h3 {
    margin: 0 0 5px;
    color: #ffe1a0;
    font-size: 17px;
}

.txm-md5-head p {
    margin: 0;
    color: rgba(255, 248, 224, .70);
    font-size: 13px;
}

.txm-md5-badge {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff3bd, #9d5d1f);
    color: #1b0a03;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 5px 10px rgba(0,0,0,.28);
}

.txm-md5-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.txm-md5-grid label {
    display: block;
    color: rgba(255, 248, 224, .82);
    font-size: 12px;
    font-weight: 800;
}

.txm-copy-line,
.txm-checker {
    display: grid;
    gap: 7px;
    margin-top: 6px;
}

.txm-copy-line {
    grid-template-columns: 1fr auto;
}

.txm-copy-line input,
.txm-checker input {
    min-height: 38px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 230, 163, .23);
    background: rgba(0,0,0,.38);
    color: #fff4cc;
    padding: 0 10px;
    outline: 0;
    font-size: 12px;
}

.txm-copy-btn,
.txm-check-btn {
    border-radius: 10px;
    padding: 0 12px;
    min-height: 38px;
    background: linear-gradient(180deg, #fff0b0, #a36526);
    color: #230d03;
    font-weight: 900;
}

.txm-checker {
    grid-template-columns: 1fr 1fr auto;
    margin-top: 11px;
}

.txm-check-result {
    margin-top: 10px;
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.30);
    border: 1px solid rgba(255, 230, 163, .14);
    color: rgba(255, 248, 224, .72);
    font-size: 13px;
    font-weight: 800;
}

.txm-check-result.ok {
    color: #8cffb0;
    border-color: rgba(140, 255, 176, .34);
}

.txm-check-result.fail {
    color: #ff9b9b;
    border-color: rgba(255, 155, 155, .34);
}

.txm-log-panel {
    overflow: hidden;
}

.txm-log-title {
    padding: 11px 15px;
    color: #ffe1a0;
    font-weight: 900;
    border-bottom: 1px solid rgba(255, 230, 163, .14);
}

.txm-log-list {
    margin: 0;
    padding: 12px 18px 14px 32px;
    max-height: 156px;
    overflow: auto;
    color: rgba(255, 248, 224, .76);
    font-size: 13px;
}

.txm-log-list li {
    margin-bottom: 7px;
}

@media (max-width: 860px) {
    .txm-topbar {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .txm-actions {
        justify-content: center;
    }

    .txm-user-pill {
        max-width: 180px;
        margin: 0 auto;
    }

    .txm-board {
        grid-template-columns: 1fr;
    }

    .txm-center {
        order: -1;
    }

    .txm-side {
        min-height: 172px;
    }

    .txm-md5-grid,
    .txm-checker {
        grid-template-columns: 1fr;
    }

    .txm-check-btn {
        min-height: 42px;
    }
}

@media (max-width: 520px) {
    .txm-game {
        margin: 18px auto;
    }

    .txm-frame {
        border-radius: 18px;
        padding: 12px;
    }

    .txm-title-wrap h2 {
        font-size: 36px;
    }

    .txm-dice-icon,
    .txm-coins {
        display: none;
    }

    .txm-timer-ring {
        width: 148px;
        height: 148px;
    }

    .txm-timer {
        font-size: 52px;
    }

    .txm-input-row {
        grid-template-columns: 1fr;
    }

    .txm-history-bar {
        grid-template-columns: 1fr;
    }

    .txm-mini-icon {
        display: none;
    }

    .txm-md5-head {
        display: block;
    }

    .txm-md5-badge {
        display: inline-flex;
        margin-top: 8px;
    }
}
