.cg-toast {
    display: none !important;
}

.tj-shell {
    --tj-cell: 40px;
    --tj-gut: 16px;
    --tj-mid: 2;
    --tj-gap: calc(var(--tj-cell) * 0.08);
    --tj-half: calc(var(--tj-cell) * 0.04);
    width: min(100%, 1040px) !important;
    max-width: 1040px !important;
    margin: 0 auto;
    padding: 14px 16px 26px;
    color: var(--cg-ink);
    font-family: Inter, Arial, sans-serif;
}

.tj-topbar,
.tj-stats,
.tj-actions,
.tj-bar,
.tj-winrow {
    display: flex;
    align-items: center;
}

.tj-topbar {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.tj-stats,
.tj-actions {
    gap: 8px;
}

.tj-stat {
    min-width: 76px;
    padding: 8px 12px;
    border: 1px solid var(--cg-line);
    border-radius: 12px;
    background: var(--cg-panel);
    box-shadow: 0 8px 18px rgba(30, 37, 40, 0.08);
}

.tj-stat span {
    display: block;
    color: var(--cg-muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tj-stat strong {
    display: block;
    margin-top: 3px;
    font-size: 19px;
    line-height: 1;
}

.tj-btn {
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--cg-line);
    border-radius: 11px;
    background: var(--cg-panel);
    color: var(--cg-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.1s ease, filter 0.1s ease;
}

.tj-btn:hover {
    border-color: var(--cg-teal);
    transform: translateY(-1px);
}

.tj-btn:active {
    transform: translateY(0);
}

.tj-btn:focus-visible,
.tj-dir:focus-visible,
.tj-close:focus-visible,
.tj-lv-cell:focus-visible,
.tj-grid:focus-visible {
    outline: 3px solid rgba(33, 199, 214, 0.65);
    outline-offset: 2px;
}

.tj-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tj-icon svg {
    width: 21px;
    height: 21px;
}

.tj-primary {
    background: #1d7f62;
    border-color: #1d7f62;
    color: #fff;
}

.tj-primary:hover {
    border-color: #1d7f62;
    filter: brightness(1.08);
}

.tj-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: clamp(300px, calc(100vh - 372px), 600px);
    padding: 9px;
    border: 1px solid #0d151c;
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 8%, rgba(255, 186, 92, 0.22), transparent 62%),
        linear-gradient(168deg, #232c35, #10161c 62%, #0a0e12);
    box-shadow: var(--cg-shadow);
    overflow: hidden;
}

.tj-frame {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    touch-action: none;
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0 7px, rgba(255, 255, 255, 0.04) 7px 14px),
        linear-gradient(158deg, #c3bdaf 0%, #948d80 58%, #7b7469 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.32),
        inset 0 0 0 7px rgba(28, 24, 18, 0.22),
        0 20px 44px rgba(4, 8, 12, 0.55);
}

.tj-grid {
    position: absolute;
    inset: var(--tj-gut);
    border-radius: 10px;
    outline: none;
    touch-action: none;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px var(--tj-cell)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px var(--tj-cell)),
        radial-gradient(128% 100% at 50% 46%, rgba(255, 199, 122, 0.17), transparent 64%),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0 2px, rgba(255, 255, 255, 0.014) 2px 6px),
        linear-gradient(180deg, #2d343d 0%, #1a2027 58%, #10151a 100%);
    box-shadow:
        inset 0 0 0 2px #79808b,
        inset 0 12px 30px rgba(0, 0, 0, 0.5);
}

.tj-lane {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.tj-lane-v {
    top: var(--tj-gut);
    bottom: var(--tj-gut);
    left: calc(var(--tj-gut) + var(--tj-mid) * var(--tj-cell));
    width: var(--tj-cell);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0));
}

.tj-lane-v::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    margin-left: -1.5px;
    background: repeating-linear-gradient(180deg, rgba(255, 220, 148, 0.8) 0 14px, transparent 14px 32px);
}

.tj-lane-h {
    left: var(--tj-gut);
    right: var(--tj-gut);
    top: calc(var(--tj-gut) + var(--tj-mid) * var(--tj-cell));
    height: var(--tj-cell);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0));
}

.tj-lane-h::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
    background: repeating-linear-gradient(90deg, rgba(255, 220, 148, 0.8) 0 14px, transparent 14px 32px);
}

.tj-gate {
    position: absolute;
    z-index: 3;
    opacity: 0.6;
    border-radius: 5px;
    background:
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.45) 0 5px, rgba(255, 255, 255, 0) 5px 11px),
        linear-gradient(180deg, var(--c1), var(--c2));
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.tj-gate[data-side="left"] {
    left: calc(var(--tj-cell) * -0.3);
    top: calc(var(--line) * var(--tj-cell) + 3px);
    width: calc(var(--tj-cell) * 0.5);
    height: calc(var(--tj-cell) - 6px);
    border-radius: 7px 2px 2px 7px;
}

.tj-gate[data-side="right"] {
    right: calc(var(--tj-cell) * -0.3);
    top: calc(var(--line) * var(--tj-cell) + 3px);
    width: calc(var(--tj-cell) * 0.5);
    height: calc(var(--tj-cell) - 6px);
    border-radius: 2px 7px 7px 2px;
}

.tj-gate[data-side="top"] {
    top: calc(var(--tj-cell) * -0.3);
    left: calc(var(--line) * var(--tj-cell) + 3px);
    height: calc(var(--tj-cell) * 0.5);
    width: calc(var(--tj-cell) - 6px);
    border-radius: 7px 7px 2px 2px;
}

.tj-gate[data-side="bottom"] {
    bottom: calc(var(--tj-cell) * -0.3);
    left: calc(var(--line) * var(--tj-cell) + 3px);
    height: calc(var(--tj-cell) * 0.5);
    width: calc(var(--tj-cell) - 6px);
    border-radius: 2px 2px 7px 7px;
}

.tj-gate i {
    position: absolute;
    width: 0;
    height: 0;
    border: 7px solid transparent;
}

.tj-gate[data-side="left"] i {
    left: 4px;
    top: 50%;
    margin-top: -7px;
    border-right: 0;
    border-left-color: rgba(255, 255, 255, 0.9);
}

.tj-gate[data-side="right"] i {
    right: 4px;
    top: 50%;
    margin-top: -7px;
    border-left: 0;
    border-right-color: rgba(255, 255, 255, 0.9);
}

.tj-gate[data-side="top"] i {
    top: 4px;
    left: 50%;
    margin-left: -7px;
    border-bottom: 0;
    border-top-color: rgba(255, 255, 255, 0.9);
}

.tj-gate[data-side="bottom"] i {
    bottom: 4px;
    left: 50%;
    margin-left: -7px;
    border-top: 0;
    border-bottom-color: rgba(255, 255, 255, 0.9);
}

.tj-gate.tj-open {
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 14px var(--cg), 0 0 34px var(--cg);
    animation: tj-pulse 1.5s ease-in-out infinite;
}

.tj-gate.tj-sel {
    filter: brightness(1.18) saturate(1.1);
}

.tj-car {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    width: calc(var(--w) * var(--tj-cell) - var(--tj-gap));
    height: calc(var(--h) * var(--tj-cell) - var(--tj-gap));
    transform: translate3d(calc(var(--x) * var(--tj-cell) + var(--tj-half)), calc(var(--y) * var(--tj-cell) + var(--tj-half)), 0);
    border-radius: 8px;
    background: linear-gradient(158deg, var(--c1) 0%, var(--c2) 78%);
    box-shadow:
        0 5px 11px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 0, 0, 0.34),
        inset 0 2px 0 rgba(255, 255, 255, 0.38),
        inset 0 -5px 9px rgba(0, 0, 0, 0.3);
    transition: transform 0.16s cubic-bezier(0.24, 0.86, 0.3, 1.16), box-shadow 0.16s ease, filter 0.16s ease;
    touch-action: none;
}

.tj-car[data-tj-axis="v"] {
    background: linear-gradient(202deg, var(--c1) 0%, var(--c2) 78%);
}

.tj-skin {
    position: absolute;
    inset: 0;
}

.tj-car[data-tj-axis="h"] {
    --t: 14%;
    --b: 14%;
}

.tj-car[data-tj-axis="v"] {
    --t: 9%;
    --b: 9%;
}

.tj-car[data-tj-face="away"][data-tj-axis="h"] .tj-skin {
    transform: scaleX(-1);
}

.tj-car[data-tj-face="away"][data-tj-axis="v"] .tj-skin {
    transform: scaleY(-1);
}

.tj-car > .tj-skin > i {
    position: absolute;
    display: block;
    border-radius: 3px;
}

.tj-car[data-tj-axis="h"] > .tj-skin > i {
    right: var(--s);
    top: var(--t);
    width: var(--l);
    height: calc(100% - var(--t) - var(--b));
}

.tj-car[data-tj-axis="v"] > .tj-skin > i {
    bottom: var(--s);
    left: var(--t);
    height: var(--l);
    width: calc(100% - var(--t) - var(--b));
}

.tj-hood {
    --s: 5%;
    --l: 20%;
    background:
        radial-gradient(circle at 72% 25%, #fff8e0 0 26%, rgba(255, 248, 224, 0) 44%),
        radial-gradient(circle at 72% 75%, #fff8e0 0 26%, rgba(255, 248, 224, 0) 44%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.1) 52%, rgba(0, 0, 0, 0.24) 100%);
    box-shadow: 0 0 11px rgba(255, 238, 196, 0.4);
    border-radius: 3px 6px 6px 3px;
}

.tj-car[data-tj-axis="v"] > .tj-skin > .tj-hood {
    background:
        radial-gradient(circle at 25% 72%, #fff8e0 0 26%, rgba(255, 248, 224, 0) 44%),
        radial-gradient(circle at 75% 72%, #fff8e0 0 26%, rgba(255, 248, 224, 0) 44%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.1) 52%, rgba(0, 0, 0, 0.24) 100%);
    border-radius: 3px 3px 6px 6px;
}

.tj-cab {
    --s: 27%;
    --l: 16%;
    background:
        linear-gradient(118deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 46%),
        linear-gradient(180deg, #3a4d61 0%, #1d2937 58%, #101922 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 1px 3px rgba(0, 0, 0, 0.55);
}

.tj-box {
    --s: 45%;
    --l: 18%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

.tj-tail {
    --s: 95%;
    --l: 5%;
    background:
        radial-gradient(circle at 50% 24%, #ff5f47 0 30%, rgba(255, 95, 71, 0) 34%),
        radial-gradient(circle at 50% 76%, #ff5f47 0 30%, rgba(255, 95, 71, 0) 34%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.12) 100%);
    box-shadow: 0 0 9px rgba(255, 86, 60, 0.6);
    border-radius: 2px 4px 4px 2px;
}

.tj-car[data-tj-axis="v"] > .tj-skin > .tj-tail {
    background:
        radial-gradient(circle at 24% 50%, #ff5f47 0 30%, rgba(255, 95, 71, 0) 34%),
        radial-gradient(circle at 76% 50%, #ff5f47 0 30%, rgba(255, 95, 71, 0) 34%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.12) 100%);
    border-radius: 4px 4px 2px 2px;
}

.tj-car[data-tj-kind="truck"] > .tj-skin > .tj-hood {
    --s: 2%;
    --l: 27%;
    border-radius: 5px 7px 7px 5px;
}

.tj-car[data-tj-kind="truck"] > .tj-skin > .tj-cab {
    --s: 31%;
    --l: 22%;
}

.tj-car[data-tj-kind="truck"] > .tj-skin > .tj-box {
    --s: 35%;
    --l: 61%;
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 3px, rgba(255, 255, 255, 0.08) 3px 9px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(0, 0, 0, 0.24) 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.tj-car[data-tj-kind="truck"][data-tj-axis="v"] > .tj-skin > .tj-box {
    background:
        repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 3px, rgba(255, 255, 255, 0.08) 3px 9px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0%, rgba(0, 0, 0, 0.24) 100%);
}

.tj-car[data-tj-kind="truck"] > .tj-skin > .tj-tail {
    --s: 96%;
    --l: 4%;
}

.tj-car.tj-sel {
    z-index: 5;
    filter: brightness(1.09);
    box-shadow:
        0 0 0 3px var(--cg),
        0 8px 16px rgba(0, 0, 0, 0.55),
        0 0 22px var(--cg),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -5px 9px rgba(0, 0, 0, 0.3);
}

.tj-car.tj-drag {
    transition: none;
    z-index: 7;
    filter: brightness(1.14);
}

.tj-car.tj-leaving {
    transition: transform 0.46s cubic-bezier(0.5, 0, 0.82, 0.18);
    filter: saturate(0.7) brightness(0.95);
}

.tj-car.tj-leaving .tj-tail {
    animation: tj-tailoff 0.52s ease-out forwards;
}

.tj-car.tj-bad > .tj-skin {
    animation: tj-jolt 0.3s ease-in-out;
}

.tj-car[data-tj-axis="v"].tj-bad > .tj-skin {
    animation-name: tj-joltv;
}

.tj-car.tj-hint {
    animation: tj-hintring 1s ease-out 2;
}

.tj-spark {
    position: absolute;
    z-index: 8;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, #fff 0%, var(--cg, #ffd08a) 55%, rgba(255, 208, 138, 0) 72%);
    animation: tj-spark var(--dur, 400ms) ease-out forwards;
}

.tj-shake {
    animation: tj-jolt 0.36s ease-out;
}

.tj-status {
    margin: 11px 2px 9px;
    color: var(--cg-muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-align: center;
}

.tj-bar {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tj-pad {
    display: grid;
    grid-template-areas:
        ". u ."
        "l m r"
        ". d .";
    grid-template-columns: repeat(3, 46px);
    grid-template-rows: repeat(3, 46px);
    gap: 3px;
    margin-left: 6px;
}

.tj-dir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--cg-line);
    border-radius: 11px;
    background: linear-gradient(170deg, #ffffff, #eef1ec);
    color: #1e2528;
    box-shadow: 0 4px 10px rgba(30, 37, 40, 0.12);
    cursor: pointer;
    touch-action: none;
    transition: opacity 0.12s ease, transform 0.1s ease, border-color 0.12s ease;
}

.tj-dir svg {
    width: 22px;
    height: 22px;
}

.tj-dir:active {
    transform: translateY(1px);
    border-color: var(--cg-teal);
}

.tj-dir:disabled {
    opacity: 0.34;
    cursor: default;
    box-shadow: none;
}

.tj-dir.tj-flash {
    animation: tj-flash 0.55s ease-out 2;
}

.tj-padmid {
    grid-area: m;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #2b333c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.tj-padmid::after {
    content: attr(data-name);
    color: #10151a;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tj-padmid:empty,
.tj-padmid[attr-data-name=""]::after {
    content: '';
}

.tj-dir[data-tj-dir="up"] { grid-area: u; }
.tj-dir[data-tj-dir="left"] { grid-area: l; }
.tj-dir[data-tj-dir="right"] { grid-area: r; }
.tj-dir[data-tj-dir="down"] { grid-area: d; }

.tj-win {
    position: absolute;
    inset: 0;
    z-index: 9;
    display: grid;
    place-items: center;
    padding: 14px;
    border-radius: 21px;
    background: rgba(8, 12, 16, 0.76);
}

.tj-win[hidden] {
    display: none;
}

.tj-card {
    width: min(100%, 330px);
    padding: 18px 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 190, 92, 0.2), transparent 62%),
        linear-gradient(172deg, #1f2832 0%, #131a20 100%);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
    color: #eef2f4;
    text-align: center;
    animation: tj-pop 0.28s cubic-bezier(0.2, 1.1, 0.4, 1);
}

.tj-kicker {
    display: block;
    color: #ffb347;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tj-card strong {
    display: block;
    margin: 5px 0 9px;
    font-size: 20px;
    line-height: 1.2;
}

.tj-starline {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 7px;
}

.tj-star {
    color: rgba(255, 255, 255, 0.2);
    font-size: 20px;
    line-height: 1;
}

.tj-star.on {
    color: #ffc04a;
    text-shadow: 0 0 14px rgba(255, 180, 60, 0.65);
}

.tj-card p {
    margin: 0 0 13px;
    color: #a3b0b8;
    font-size: 0.82rem;
    font-weight: 700;
}

.tj-winrow {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tj-winrow .tj-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #eef2f4;
}

.tj-winrow .tj-primary {
    background: #1d7f62;
    border-color: #1d7f62;
    color: #fff;
}

.tj-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(12, 17, 21, 0.62);
}

.tj-modal[hidden] {
    display: none;
}

.tj-modal-card {
    position: relative;
    width: min(100%, 420px);
    max-height: 84vh;
    overflow: auto;
    padding: 24px 22px 22px;
    border: 1px solid var(--cg-line);
    border-radius: 18px;
    background: var(--cg-panel);
    box-shadow: 0 26px 54px rgba(20, 27, 32, 0.34);
}

.tj-modal-wide {
    width: min(100%, 460px);
}

.tj-modal-card h2 {
    margin: 0 0 10px;
    font-size: 1.22rem;
}

.tj-modal-card h3.tj-lv-group {
    margin: 14px 0 7px;
    color: var(--cg-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tj-modal-card p {
    margin: 0 0 11px;
    color: #4a555a;
    font-size: 0.92rem;
    line-height: 1.5;
}

.tj-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--cg-line);
    border-radius: 50%;
    background: var(--cg-bg);
    color: var(--cg-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.tj-close:hover {
    color: var(--cg-ink);
    background: #fff;
}

.tj-lv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    gap: 7px;
}

.tj-lv-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 56px;
    padding: 4px;
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    background: var(--cg-panel);
    color: var(--cg-ink);
    font: inherit;
    cursor: pointer;
}

.tj-lv-cell strong {
    font-size: 0.95rem;
}

.tj-lv-stars {
    display: flex;
    gap: 1px;
}

.tj-lv-stars .tj-star {
    font-size: 10px;
}

.tj-lv-best {
    color: var(--cg-muted);
    font-size: 0.66rem;
    font-weight: 800;
}

.tj-lv-done {
    border-color: #84b8a6;
    background: #e6f6ef;
    color: #14563f;
}

.tj-lv-now {
    border-color: var(--cg-teal);
    box-shadow: 0 0 0 2px rgba(18, 122, 137, 0.3);
}

@keyframes tj-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.28); }
}

@keyframes tj-tailoff {
    from { opacity: 1; box-shadow: 0 0 9px rgba(255, 86, 60, 0.6); }
    to { opacity: 0.12; box-shadow: 0 0 0 rgba(255, 86, 60, 0); }
}

@keyframes tj-jolt {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-4px, 2px); }
    45% { transform: translate(4px, -2px); }
    70% { transform: translate(-3px, -1px); }
}

@keyframes tj-joltv {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(2px, -4px); }
    45% { transform: translate(-2px, 4px); }
    70% { transform: translate(1px, -3px); }
}

@keyframes tj-hintring {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.85), 0 5px 11px rgba(0, 0, 0, 0.5); }
    100% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0), 0 5px 11px rgba(0, 0, 0, 0.5); }
}

@keyframes tj-flash {
    0%, 100% { background: linear-gradient(170deg, #ffffff, #eef1ec); }
    50% { background: linear-gradient(170deg, #fff0cd, #ffd98f); }
}

@keyframes tj-spark {
    from { transform: translate(0, 0) scale(var(--sc, 1)); opacity: 0.95; }
    to { transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.15); opacity: 0; }
}

@keyframes tj-pop {
    from { transform: translateY(10px) scale(0.94); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (max-width: 900px) {
    .tj-shell {
        padding: 10px 10px 22px;
    }

    .tj-topbar {
        gap: 8px;
    }

    .tj-stat {
        min-width: 0;
        flex: 1;
        padding: 7px 8px;
    }

    .tj-stat strong {
        font-size: 16px;
    }

    .tj-stats,
    .tj-actions {
        gap: 6px;
    }

    .tj-stage {
        height: auto;
        min-height: 260px;
        max-height: 66vh;
        aspect-ratio: 1 / 1.04;
        padding: 7px;
        border-radius: 18px;
    }

    .tj-btn {
        padding: 9px 10px;
        font-size: 0.82rem;
    }

    .tj-status {
        margin: 9px 2px 8px;
        font-size: 0.8rem;
    }

    .tj-bar {
        gap: 7px;
    }

    .tj-pad {
        margin-left: 0;
    }
}

@media (max-width: 420px) {
    .tj-stat {
        padding: 7px 5px;
    }

    .tj-stat span {
        font-size: 9px;
    }

    .tj-icon {
        width: 44px;
    }

    .tj-btn {
        padding: 9px 8px;
        font-size: 0.8rem;
    }

    .tj-pad {
        grid-template-columns: repeat(3, 44px);
        grid-template-rows: repeat(3, 44px);
    }
}

.tj-pad {
    grid-template-areas: "l u m d r";
    grid-template-columns: repeat(5, 46px);
    grid-template-rows: 46px;
    margin: 0;
}

.tj-bar {
    flex-wrap: wrap;
    gap: 8px 8px;
    align-items: center;
}

.tj-frame { max-width: 660px; }
.tj-stage { height: clamp(300px, calc(100vh - 300px), 700px); }

.tj-status {
    margin: 8px 2px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .tj-stage { height: auto; max-height: 72vh; padding: 5px; }
    .tj-frame { max-width: none; }
    .tj-pad { grid-template-columns: repeat(5, 44px); grid-template-rows: 44px; }
    .tj-bar { justify-content: space-between; }
    .tj-btn { padding: 9px 9px; }
}

@media (max-width: 420px) {
    .tj-pad { grid-template-columns: repeat(5, 44px); grid-template-rows: 44px; }
    .tj-bar { gap: 6px; }
}

@media (max-width: 900px) {
    .tj-pad { margin: 0 auto; }
}
