.custom-game-stage[hidden],.custom-game-live[hidden],.custom-game-results[hidden],.tug-world[hidden]{display:none}.custom-game-stage{overflow:hidden;border:1px solid #dbe3ef;border-radius:18px;background:#fff;box-shadow:0 18px 50px rgba(18,33,63,.1)}.adventure-card .game-icon{background:#e6f7e9}.tug-card .game-icon{background:#ffe6e8}.custom-game-setup{max-width:820px;margin:auto;padding:28px}.custom-game-intro{display:flex;align-items:center;gap:15px;margin-bottom:20px}.custom-game-intro>span{display:grid;place-items:center;width:64px;height:64px;border-radius:18px;background:#e7f5ff;font-size:2rem}.custom-game-intro h2{margin:0 0 5px}.custom-game-intro p{margin:0;color:#6f7b8d}.custom-list-label{display:flex;flex-direction:column;gap:7px;color:#344054;font-weight:800}.custom-list-label textarea{min-height:180px;resize:vertical;padding:14px;border:1px solid #cbd5e1;border-radius:12px;font:500 1.15rem/1.7 Padauk,Inter,sans-serif}.custom-list-label small{color:#6f7b8d;font-weight:500}.custom-list-tools,.custom-options{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.custom-list-tools select{flex:1;min-width:190px}.custom-options label{display:flex;flex:1;min-width:180px;flex-direction:column;gap:6px;color:#344054;font-weight:800}.custom-options select,.custom-options input,.custom-list-tools select{min-height:44px;padding:0 11px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;font:inherit}.custom-start{width:100%;margin-top:12px}.custom-error{min-height:20px;margin:10px 0 0;color:#b42318;font-weight:700}.custom-game-stats{display:grid;grid-template-columns:repeat(3,1fr);background:#f7fbff;border-bottom:1px solid #dbe3ef}.custom-game-stats div{padding:12px;text-align:center;border-right:1px solid #dbe3ef}.custom-game-stats div:last-child{border:0}.custom-game-stats span,.custom-game-stats strong{display:block}.custom-game-stats span{color:#748095;font-size:.7rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.custom-game-stats strong{color:#173868;font-size:1.3rem}.adventure-world,.tug-world{position:relative;min-height:190px;overflow:hidden;background:linear-gradient(#bde8ff 0 58%,#74bd62 58% 100%)}.adventure-sky{padding:17px;color:#145278;font-weight:900;text-align:center;letter-spacing:.12em;text-transform:uppercase}.adventure-path{position:absolute;left:6%;right:6%;bottom:30px;height:18px;border-radius:99px;background:#dcc08c;box-shadow:0 5px 0 #ad8450}.adventure-path i{position:absolute;top:-5px;width:27px;height:27px;border:4px solid #fff;border-radius:50%;background:#38a169;transform:translateX(-50%)}.adventure-path i:nth-of-type(1){left:20%}.adventure-path i:nth-of-type(2){left:40%}.adventure-path i:nth-of-type(3){left:60%}.adventure-path i:nth-of-type(4){left:80%}.adventure-path i:nth-of-type(5){left:100%}.adventure-player{position:absolute;z-index:2;left:0;bottom:-4px;font-size:2.5rem;transform:translateX(-50%);transition:left .5s cubic-bezier(.2,.8,.2,1)}.custom-challenge{padding:22px;text-align:center}.custom-challenge>span{color:#748095;font-size:.7rem;font-weight:900;letter-spacing:.12em}.custom-target{max-width:1000px;margin:8px auto 0;color:#17233b;font:700 clamp(1.7rem,4vw,2.65rem)/1.65 Padauk,Inter,sans-serif}.custom-target .done{color:#15956d}.custom-target .current{padding:0 2px;border-radius:4px;background:#ffe48b}.custom-typed{min-height:40px;color:#16845c;font:700 1.3rem/1.6 Padauk,Inter,sans-serif}.custom-typed.wrong{color:#d92d20}.custom-challenge p{margin:3px 0;color:#748095}.custom-game-results{min-height:520px;padding:80px 24px;text-align:center;background:#fff}.custom-game-results>span{font-size:4rem}.custom-game-results h2{margin:12px 0 8px;color:#173868;font-size:2rem}.custom-game-results p{margin:0 0 22px;color:#667085}.custom-game-results>div{display:flex;justify-content:center;gap:10px}.custom-game-stage .game-keyboard{padding:8px 14px 20px}body.theme-rgb .custom-game-stage,body.theme-rgb .custom-game-setup,body.theme-rgb .custom-game-results{color:#eef5ff;background:#0b1729!important;border-color:#2b4566!important}body.theme-rgb .custom-game-intro p,body.theme-rgb .custom-list-label small,body.theme-rgb .custom-challenge p,body.theme-rgb .custom-game-results p{color:#a5b5cc}body.theme-rgb .custom-list-label,body.theme-rgb .custom-options label,body.theme-rgb .custom-game-results h2{color:#f4f8ff}body.theme-rgb .custom-list-label textarea,body.theme-rgb .custom-options select,body.theme-rgb .custom-options input,body.theme-rgb .custom-list-tools select{color:#eef5ff;background:#111f36;border-color:#3a5778}body.theme-rgb .custom-game-stats{background:#0d1a2d;border-color:#2a4262}body.theme-rgb .custom-game-stats div{border-color:#2a4262}body.theme-rgb .custom-game-stats strong{color:#fff}body.theme-rgb .custom-target{color:#d9e7fb}body.theme-rgb .custom-target .done{color:#50e6ad}body.theme-rgb .custom-target .current{color:#07101f;background:#ffd84d}body.theme-rgb .custom-game-results{background:#081426!important}@media(max-width:720px){.custom-game-setup{padding:18px}.custom-list-tools,.custom-options{flex-direction:column}.custom-list-tools>*{width:100%}.custom-game-results>div{flex-direction:column}.adventure-world,.tug-world{min-height:150px}.custom-challenge{padding:16px 10px}}

/* Classroom Typing Tug of War */
.tug-class-setup[hidden],.tug-lobby[hidden],.tug-teacher-live[hidden],.tug-teacher-results[hidden],.tug-team-field[hidden],.tug-world[hidden]{display:none!important}
.tug-class-setup{max-width:1080px;margin:auto;padding:28px}.tug-class-intro{position:relative}.tug-class-intro>b{margin-left:auto;padding:7px 11px;border:1px solid #c7d7ea;border-radius:999px;color:#3d5d83;background:#f6fbff;font-size:.78rem}
.tug-class-options{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(315px,.82fr);gap:18px}.tug-option{display:flex;flex-direction:column;gap:13px;padding:20px;border:1px solid #dbe3ef;border-radius:16px;background:#f9fbfe}.tug-option-heading{display:flex;align-items:center;gap:12px}.tug-option-heading>span{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:#eaf3ff;font-size:1.65rem}.tug-option-heading strong{display:block;color:#173868;font-size:1.15rem}.tug-option-heading p{margin:2px 0 0;color:#6f7b8d;font-size:.9rem}.tug-option label{display:flex;flex-direction:column;gap:6px;color:#344054;font-weight:800}.tug-option textarea,.tug-option input,.tug-option select{width:100%;box-sizing:border-box;padding:11px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#17233b;font:inherit}.tug-option textarea{min-height:174px;resize:vertical;font:500 1.08rem/1.65 Padauk,Inter,sans-serif}.tug-option small{color:#6f7b8d;font-weight:500}.tug-host-settings{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tug-host-settings label:last-child{grid-column:1/-1}.tug-rule-note,.tug-team-note{margin:0;color:#68778d;font-size:.84rem;line-height:1.45}.tug-rule-note{padding:10px 12px;border-radius:10px;background:#eef6ff;border:1px solid #d2e5fa}
.tug-avatar-field,.tug-team-field{margin:0;padding:0;border:0}.tug-avatar-field legend,.tug-team-field legend{margin-bottom:8px;color:#344054;font-weight:800}.tug-avatar-picker{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}.tug-avatar-choice{min-height:50px;border:2px solid #d9e3ef;border-radius:12px;background:#fff;font-size:1.55rem;cursor:pointer;transition:.15s ease}.tug-avatar-choice:hover{transform:translateY(-1px);border-color:#8db8eb}.tug-avatar-choice.selected{border-color:#2f80ed;background:#eaf4ff;box-shadow:0 0 0 3px rgba(47,128,237,.12)}
.tug-team-picker{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tug-team-choice{min-height:48px;border:2px solid #d5dfeb;border-radius:12px;background:#fff;color:#344054;font-weight:900;cursor:pointer}.tug-team-choice.red.selected{border-color:#e5484d;background:#fff0f1;color:#a51d28}.tug-team-choice.blue.selected{border-color:#3478e5;background:#edf5ff;color:#1856ae}.tug-team-choice:disabled{opacity:.4;cursor:not-allowed}
.tug-lobby{min-height:520px;padding:34px;background:linear-gradient(180deg,#f8fbff,#fff)}.tug-room-code{display:flex;align-items:center;justify-content:center;gap:14px;max-width:640px;margin:0 auto 26px;padding:16px 20px;border:1px solid #cfe0f3;border-radius:16px;background:#eef7ff}.tug-room-code>span{color:#64748b;font-size:.72rem;font-weight:900;letter-spacing:.13em}.tug-room-code>strong{color:#153866;font-size:2rem;letter-spacing:.17em}.tug-lobby-copy{text-align:center}.tug-lobby-copy h2{margin:0 0 7px;color:#173868}.tug-lobby-copy p{margin:0 0 10px;color:#68778d}.tug-lobby-copy>strong{display:block;margin-bottom:16px;color:#315a86}.tug-lobby-teams{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-width:1000px;margin:26px auto 0}.tug-lobby-team{min-height:150px;padding:16px;border:2px solid #dbe4ef;border-radius:16px;background:#fff}.tug-lobby-team.red{border-color:#f2b8bb;background:#fff7f7}.tug-lobby-team.blue{border-color:#b9d4fa;background:#f7fbff}.tug-lobby-team.unassigned{grid-column:1/-1;border-style:dashed;background:#fafbfc}.tug-lobby-team h3{margin:0 0 12px;color:#294667}.tug-player-chips{display:flex;flex-wrap:wrap;gap:9px}.tug-player-chip,.tug-empty-player{display:flex;align-items:center;gap:8px;padding:9px 11px;border:1px solid #d5e0ee;border-radius:999px;background:#fff;color:#294667;font-weight:800;box-shadow:0 5px 16px rgba(31,64,104,.06)}.tug-player-chip>b{font-size:1.25rem}.tug-chip-controls{display:flex;gap:4px;margin-left:2px}.tug-chip-controls button{display:grid;place-items:center;width:24px;height:24px;border:0;border-radius:50%;font-size:.7rem;font-weight:900;cursor:pointer}.tug-mini-team.red{background:#ffe0e2;color:#a51d28}.tug-mini-team.blue{background:#dfeeff;color:#1856ae}.tug-chip-controls button:disabled{opacity:.32;cursor:default}.tug-remove-player{background:#fee4e2;color:#b42318!important;font-size:1rem!important}
.tug-teacher-live{min-height:540px;padding:26px;background:#f7fbff}.tug-teacher-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.tug-teacher-head>div:first-child>span{color:#7b4cc9;font-size:.7rem;font-weight:900;letter-spacing:.13em}.tug-teacher-head h2{margin:4px 0 0;color:#173868}.tug-teacher-head>div:last-child{display:flex;align-items:center;gap:12px;color:#64748b}.tug-teacher-head>div:last-child>span{padding:8px 11px;border:1px solid #cfdeef;border-radius:10px;background:#fff;font-size:.78rem;font-weight:800}.tug-teacher-head>div:last-child strong{color:#173868;letter-spacing:.08em}
.tug-teacher-arena{display:grid;grid-template-columns:150px minmax(260px,1fr) 150px;align-items:center;gap:16px;margin-bottom:20px;padding:20px;border:1px solid #d7e2ef;border-radius:18px;background:#fff;box-shadow:0 8px 24px rgba(31,64,104,.06)}.tug-arena-score{text-align:center}.tug-arena-score span,.tug-arena-score strong,.tug-arena-score small{display:block}.tug-arena-score span{font-size:.72rem;font-weight:900;letter-spacing:.1em}.tug-arena-score strong{font-size:2rem}.tug-arena-score.red span,.tug-arena-score.red strong{color:#c4313b}.tug-arena-score.blue span,.tug-arena-score.blue strong{color:#2167c9}.tug-arena-score small{color:#7b8798}.tug-rope-wrap{min-width:0}.tug-rope-line{position:relative;height:14px;margin:18px 0;border-radius:999px;background:linear-gradient(90deg,#d95b62 0 12%,#b7834d 12% 88%,#4b8de6 88% 100%);box-shadow:inset 0 2px 3px rgba(0,0,0,.2),0 2px 6px rgba(0,0,0,.08)}.tug-rope-knot{position:absolute;z-index:4;left:50%;top:50%;font-size:2rem;line-height:1;transform:translate(-50%,-50%);transition:left .38s cubic-bezier(.2,.8,.2,1);filter:drop-shadow(0 3px 2px rgba(0,0,0,.18))}.tug-finish,.tug-center{position:absolute;top:-13px;width:3px;height:40px;border-radius:3px}.tug-finish.red{left:2%;background:#d83b45}.tug-finish.blue{right:2%;background:#3478e5}.tug-center{left:50%;background:#7d8795;opacity:.55}.tug-live-avatars{display:flex;justify-content:space-between;gap:12px;min-height:34px}.tug-live-avatars>span{display:flex;flex-wrap:wrap;gap:3px;max-width:48%}.tug-live-avatars>span:last-child{justify-content:flex-end}.tug-live-avatars span span{font-size:1.45rem}
.tug-scoreboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.tug-score-team{padding:14px;border:1px solid #d8e4f1;border-radius:16px;background:#fff}.tug-score-team.red{border-top:4px solid #df4b54}.tug-score-team.blue{border-top:4px solid #3d82e6}.tug-score-team h3{margin:0 0 10px;color:#294667}.tug-score-card{display:grid;grid-template-columns:auto minmax(100px,1fr) auto;align-items:center;gap:10px;padding:10px 8px;border-top:1px solid #edf1f6}.tug-score-card:first-of-type{border-top:0}.tug-score-card.finished{opacity:.82}.tug-score-avatar{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#eef5ff;font-size:1.55rem}.tug-score-card>div:nth-child(2) strong,.tug-score-card>div:nth-child(2) span{display:block}.tug-score-card>div:nth-child(2) strong{color:#193b66}.tug-score-card>div:nth-child(2) span{margin-top:2px;color:#75849a;font-size:.75rem}.tug-score-metrics{text-align:right}.tug-score-metrics b,.tug-score-metrics span{display:block}.tug-score-metrics b{color:#173868}.tug-score-metrics span{margin-top:2px;color:#6e7d91;font-size:.72rem}.tug-score-empty{padding:20px;text-align:center;color:#75849a}
.tug-teacher-results{margin:24px auto 0;padding:28px;border:1px solid #d8d2ef;border-radius:18px;background:#faf8ff;text-align:center}.tug-teacher-results>span{font-size:3.2rem}.tug-teacher-results h2{margin:8px 0;color:#173868}.tug-teacher-results p{color:#65758a}.tug-awards{display:grid!important;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px auto;max-width:760px}.tug-awards>div{padding:13px;border:1px solid #ded8ef;border-radius:12px;background:#fff}.tug-awards span,.tug-awards strong,.tug-awards b,.tug-awards small{display:block}.tug-awards span{font-size:1.6rem}.tug-awards strong{margin:5px 0;color:#4c3d78;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em}.tug-awards b{color:#173868}.tug-awards small{margin-top:3px;color:#718096}.tug-result-actions{display:flex;justify-content:center;gap:10px;margin-top:16px}
.tug-world{display:grid!important;grid-template-columns:minmax(110px,.7fr) minmax(260px,2fr) minmax(110px,.7fr);align-items:center;gap:18px;min-height:190px;padding:22px;background:linear-gradient(180deg,#eef5ff 0,#fff 100%)}.tug-world[hidden]{display:none!important}.tug-player-team{text-align:center}.tug-player-team>span{font-size:.72rem;font-weight:900;letter-spacing:.1em}.tug-player-team.red>span{color:#c4313b}.tug-player-team.blue>span{color:#2167c9}.tug-player-team>div{display:flex;flex-wrap:wrap;justify-content:center;gap:3px;margin-top:9px}.tug-player-team>div span{font-size:1.6rem;opacity:.78}.tug-player-team>div span.me{font-size:2rem;opacity:1;filter:drop-shadow(0 0 7px rgba(255,196,0,.7))}.tug-player-rope p{margin:8px 0 0;text-align:center;color:#53657b;font-weight:800}.team-red-text{color:#d33d47!important}.team-blue-text{color:#2e76d6!important}
body.theme-rgb .tug-class-setup,body.theme-rgb .tug-lobby,body.theme-rgb .tug-teacher-live,body.theme-rgb .tug-world{color:#eef5ff;background:#0b1729!important}body.theme-rgb .tug-class-intro>b,body.theme-rgb .tug-room-code,body.theme-rgb .tug-teacher-head>div:last-child>span{color:#c8d8eb;background:#101f35;border-color:#335171}body.theme-rgb .tug-option,body.theme-rgb .tug-player-chip,body.theme-rgb .tug-lobby-team,body.theme-rgb .tug-teacher-arena,body.theme-rgb .tug-score-team,body.theme-rgb .tug-awards>div{background:#101f35;border-color:#2f4c6d}body.theme-rgb .tug-lobby-team.red{background:#2a171d;border-color:#74333c}body.theme-rgb .tug-lobby-team.blue{background:#13243c;border-color:#315782}body.theme-rgb .tug-option-heading strong,body.theme-rgb .tug-option label,body.theme-rgb .tug-avatar-field legend,body.theme-rgb .tug-team-field legend,body.theme-rgb .tug-lobby-copy h2,body.theme-rgb .tug-room-code>strong,body.theme-rgb .tug-teacher-head h2,body.theme-rgb .tug-score-team h3,body.theme-rgb .tug-score-card>div:nth-child(2) strong,body.theme-rgb .tug-score-metrics b,body.theme-rgb .tug-teacher-results h2,body.theme-rgb .tug-awards b{color:#f2f7ff}body.theme-rgb .tug-option-heading p,body.theme-rgb .tug-option small,body.theme-rgb .tug-rule-note,body.theme-rgb .tug-team-note,body.theme-rgb .tug-lobby-copy p,body.theme-rgb .tug-score-card>div:nth-child(2) span,body.theme-rgb .tug-score-metrics span,body.theme-rgb .tug-player-rope p{color:#a8b9ce}body.theme-rgb .tug-rule-note{background:#10243d;border-color:#315170}body.theme-rgb .tug-option textarea,body.theme-rgb .tug-option input,body.theme-rgb .tug-option select,body.theme-rgb .tug-avatar-choice,body.theme-rgb .tug-team-choice{color:#edf5ff;background:#14263e;border-color:#3b5b7d}body.theme-rgb .tug-avatar-choice.selected{background:#17385d;border-color:#54a7ff;box-shadow:0 0 0 3px rgba(84,167,255,.12)}body.theme-rgb .tug-score-avatar{background:#172d49}body.theme-rgb .tug-teacher-results{background:#17152a;border-color:#514477}body.theme-rgb .tug-teacher-results p{color:#b8b3cc}
@media(max-width:900px){.tug-class-options,.tug-scoreboard{grid-template-columns:1fr}.tug-class-setup,.tug-lobby,.tug-teacher-live{padding:18px}.tug-teacher-head{align-items:flex-start;flex-direction:column}.tug-teacher-arena{grid-template-columns:100px minmax(180px,1fr) 100px}.tug-lobby-teams{grid-template-columns:1fr}.tug-lobby-team.unassigned{grid-column:auto}.tug-awards{grid-template-columns:1fr!important}.tug-world{grid-template-columns:90px minmax(180px,1fr) 90px}}
@media(max-width:620px){.tug-host-settings{grid-template-columns:1fr}.tug-host-settings label:last-child{grid-column:auto}.tug-room-code{align-items:stretch;flex-direction:column;text-align:center}.tug-avatar-picker{grid-template-columns:repeat(4,1fr)}.tug-teacher-arena{grid-template-columns:1fr}.tug-arena-score{display:flex;align-items:baseline;justify-content:center;gap:7px}.tug-arena-score strong{font-size:1.5rem}.tug-world{grid-template-columns:1fr;gap:8px}.tug-player-team>div{min-height:32px}.tug-player-rope{order:2}.tug-player-team.red{order:1}.tug-player-team.blue{order:3}.tug-score-card{grid-template-columns:auto 1fr}.tug-score-metrics{grid-column:2;text-align:left}.tug-result-actions{flex-direction:column}.custom-challenge{padding:16px 10px}}
@media(max-width:440px){.tug-avatar-picker{grid-template-columns:repeat(3,1fr)}.tug-team-picker{grid-template-columns:1fr}}

/* Animated Tug of War avatars */
.tug-avatar-picker{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.tug-avatar-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:148px;padding:12px 10px;font-size:inherit;text-align:center}
.tug-avatar-choice-label{display:block;color:#294667;font-size:.76rem;font-weight:800;line-height:1.25}
.tug-player-chip{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 12px;border-radius:18px}
.tug-chip-info{display:flex;flex-direction:column;min-width:0}
.tug-chip-info strong{color:#173868;font-size:.92rem}
.tug-chip-info span{color:#708198;font-size:.72rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tug-live-avatars{min-height:126px;align-items:end}
.tug-live-avatars>span{gap:8px;align-items:flex-end}
.tug-score-avatar{display:flex;align-items:flex-end;justify-content:center;width:64px;height:78px;padding:4px;border-radius:14px;background:#eef5ff}
.tug-score-card{grid-template-columns:auto minmax(96px,1fr) auto;align-items:center}
.tug-world{grid-template-columns:minmax(160px,1.1fr) minmax(260px,1.45fr) minmax(160px,1.1fr);align-items:end;min-height:300px;padding:24px;background:linear-gradient(180deg,#eef6ff 0 52%,#d9e9fb 52% 62%,#bddc90 62% 100%)}
.tug-player-team>div{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:10px;min-height:164px}
.tug-player-rope{padding-bottom:18px}
.tug-player-rope .tug-rope-line{margin-top:0;margin-bottom:14px}
.tug-player-rope p{font-size:.94rem}
body.theme-rgb .tug-avatar-choice-label{color:#ebf3ff}
body.theme-rgb .tug-chip-info strong{color:#f2f7ff}
body.theme-rgb .tug-chip-info span{color:#a8b9ce}
body.theme-rgb .tug-score-avatar{background:#172d49}
body.theme-rgb .tug-world{background:linear-gradient(180deg,#081527 0 50%,#12263e 50% 62%,#0f2c20 62% 100%)!important}

.tug-character{--scale:1;--flip:1;--team-color:#94a3b8;display:inline-flex;flex-direction:column;align-items:center;gap:4px;min-width:70px;max-width:84px}
.tug-character.team-red{--team-color:#df4b54}
.tug-character.team-blue{--team-color:#3d82e6}
.tug-character.compact{--scale:.82;min-width:54px;max-width:62px}
.tug-character.mini{--scale:.68;min-width:46px;max-width:54px}
.tug-character.facing-left{--flip:-1}
.tug-character-name,.tug-character-meta{display:block;text-align:center;line-height:1.15}
.tug-character-name{font-size:.66rem;font-weight:900;color:#173868;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tug-character-meta{font-size:.62rem;font-weight:800;color:#5f7188}
body.theme-rgb .tug-character-name{color:#eff5ff}
body.theme-rgb .tug-character-meta{color:#9fb0c8}
.tug-character.is-me .tug-character-name{color:#7c4d00}
body.theme-rgb .tug-character.is-me .tug-character-name{color:#ffd166}
.tug-character-stage{position:relative;display:block;width:calc(62px * var(--scale));height:calc(96px * var(--scale))}
.tug-character-body{position:absolute;left:50%;bottom:0;width:calc(50px * var(--scale));height:calc(84px * var(--scale));transform:translateX(-50%) scaleX(var(--flip));transform-origin:50% 100%;animation:tugIdle 2.2s ease-in-out infinite}
.tug-character.state-ready .tug-character-body{animation:tugReady 1.1s ease-in-out infinite alternate}
.tug-character.state-pull .tug-character-body,.tug-character.state-hold .tug-character-body{animation:tugPull 1s ease-in-out infinite}
.tug-character.pulse-pull .tug-character-body{animation:tugPower .65s ease-in-out 2}
.tug-character.pulse-power .tug-character-body{animation:tugPower .48s ease-in-out 3}
.tug-character.pulse-power .tug-character-pop{background:#fff3bf;color:#8a4b00}
.tug-shadow,.tug-rope-link,.tug-leg,.tug-torso,.tug-arm,.tug-head,.tug-face,.tug-band,.tug-hair,.tug-glasses,.tug-hood,.tug-headphones,.tug-mask,.tug-helmet,.tug-robot-eye,.tug-hat,.tug-cape,.tug-satchel,.tug-dust{position:absolute;display:block;box-sizing:border-box}
.tug-shadow{left:11px;bottom:0;width:28px;height:6px;border-radius:50%;background:rgba(15,23,42,.15)}
.tug-rope-link{right:-2px;top:43px;width:18px;height:4px;border-radius:999px;background:linear-gradient(90deg,#d7a46a,#b87437)}
.tug-leg{bottom:6px;width:10px;height:28px;border-radius:999px;background:var(--pants);transform-origin:50% 0%}
.tug-leg.back{left:15px;transform:rotate(7deg)}
.tug-leg.front{left:27px;transform:rotate(-7deg)}
.tug-torso{left:13px;top:33px;width:24px;height:26px;border-radius:11px 11px 9px 9px;background:var(--shirt);box-shadow:inset 0 -4px 0 rgba(255,255,255,.16)}
.tug-arm{top:36px;width:8px;height:24px;border-radius:999px;background:var(--skin);transform-origin:50% 4px}
.tug-arm.back{left:12px;transform:rotate(45deg)}
.tug-arm.front{left:33px;transform:rotate(-60deg)}
.tug-head{left:15px;top:12px;width:20px;height:20px;border-radius:50%;background:var(--skin);z-index:2}
.tug-face{left:20px;top:20px;width:10px;height:8px;z-index:3}
.tug-face::before{content:'';position:absolute;left:1px;top:1px;width:2px;height:2px;border-radius:50%;background:#1f2937;box-shadow:6px 0 0 #1f2937}
.tug-face::after{content:'';position:absolute;left:2px;top:5px;width:6px;height:2px;border-bottom:2px solid #7c2d12;border-radius:0 0 6px 6px}
.tug-band{left:14px;top:18px;width:22px;height:5px;border-radius:999px;background:var(--team-color);z-index:4;box-shadow:0 0 0 1px rgba(255,255,255,.45) inset}
.tug-hair{left:13px;top:10px;width:24px;height:12px;border-radius:14px 14px 8px 8px;background:var(--hair);z-index:5}
.tug-glasses,.tug-hood,.tug-headphones,.tug-mask,.tug-helmet,.tug-robot-eye,.tug-hat,.tug-cape,.tug-satchel{display:none}
.tug-dust{left:9px;bottom:0;width:34px;height:12px;opacity:0}
.tug-dust::before,.tug-dust::after{content:'';position:absolute;bottom:0;width:9px;height:5px;border-radius:50%;background:rgba(180,148,87,.35)}
.tug-dust::before{left:4px}.tug-dust::after{right:5px}
.tug-character.state-pull .tug-dust,.tug-character.pulse-pull .tug-dust,.tug-character.pulse-power .tug-dust{opacity:1;animation:tugDust .55s ease-in-out infinite}
.tug-character-pop{position:absolute;left:50%;top:-2px;z-index:8;padding:3px 7px;border-radius:999px;background:#fff;border:1px solid rgba(15,23,42,.08);color:#8a2b31;font-size:.58rem;font-weight:900;white-space:nowrap;transform:translate(-50%,0);box-shadow:0 6px 16px rgba(15,23,42,.12);animation:tugPop .95s ease-out forwards}
.tug-character[data-accessory='ponytail'] .tug-hair::after{content:'';position:absolute;right:1px;top:8px;width:7px;height:13px;border-radius:0 0 8px 8px;background:var(--hair)}
.tug-character[data-accessory='glasses'] .tug-glasses{display:block;left:18px;top:20px;width:14px;height:5px;border-top:2px solid #111827;border-bottom:2px solid transparent;z-index:6}
.tug-character[data-accessory='glasses'] .tug-glasses::before,.tug-character[data-accessory='glasses'] .tug-glasses::after{content:'';position:absolute;top:0;width:5px;height:5px;border:2px solid #111827;border-radius:50%}
.tug-character[data-accessory='glasses'] .tug-glasses::before{left:0}.tug-character[data-accessory='glasses'] .tug-glasses::after{right:0}
.tug-character[data-accessory='hood'] .tug-hood{display:block;left:10px;top:10px;width:30px;height:28px;border-radius:17px 17px 8px 8px;border:4px solid var(--shirt);border-bottom:0;z-index:1;opacity:.95}
.tug-character[data-accessory='headphones'] .tug-headphones{display:block;left:11px;top:10px;width:28px;height:18px;border:3px solid #1f2937;border-bottom:0;border-radius:16px 16px 0 0;z-index:6}
.tug-character[data-accessory='headphones'] .tug-headphones::before,.tug-character[data-accessory='headphones'] .tug-headphones::after{content:'';position:absolute;top:8px;width:6px;height:10px;border-radius:6px;background:#111827}
.tug-character[data-accessory='headphones'] .tug-headphones::before{left:-2px}.tug-character[data-accessory='headphones'] .tug-headphones::after{right:-2px}
.tug-character[data-accessory='mask'] .tug-mask{display:block;left:18px;top:22px;width:14px;height:7px;border-radius:0 0 6px 6px;background:#111827;z-index:6}
.tug-character[data-accessory='helmet'] .tug-helmet{display:block;left:11px;top:8px;width:28px;height:22px;border-radius:15px 15px 10px 10px;background:#f8fafc;border:2px solid #cbd5e1;z-index:6;opacity:.9}
.tug-character[data-accessory='helmet'] .tug-helmet::after{content:'';position:absolute;left:5px;top:8px;width:18px;height:8px;border-radius:999px;background:rgba(96,165,250,.25)}
.tug-character[data-accessory='robot'] .tug-head{border-radius:6px;background:#cbd5e1;border:2px solid #94a3b8}
.tug-character[data-accessory='robot'] .tug-hair{display:none}
.tug-character[data-accessory='robot'] .tug-face::before{left:1px;top:1px;width:3px;height:3px;background:#0ea5e9;box-shadow:4px 0 0 #0ea5e9}
.tug-character[data-accessory='robot'] .tug-face::after{left:1px;top:6px;width:8px;height:0;border-bottom:2px solid #475569;border-radius:0}
.tug-character[data-accessory='robot'] .tug-robot-eye{display:block;left:24px;top:8px;width:2px;height:6px;background:#64748b;border-radius:999px}
.tug-character[data-accessory='wizard'] .tug-hat{display:block;left:9px;top:0;width:0;height:0;border-left:15px solid transparent;border-right:9px solid transparent;border-bottom:24px solid #7c3aed;z-index:7}
.tug-character[data-accessory='wizard'] .tug-hat::after{content:'';position:absolute;left:-15px;top:22px;width:24px;height:6px;border-radius:999px;background:#c4b5fd}
.tug-character[data-accessory='wizard'] .tug-cape{display:block;left:10px;top:34px;width:18px;height:22px;border-radius:4px 4px 10px 10px;background:rgba(76,29,149,.36);z-index:0}
.tug-character[data-accessory='cap'] .tug-hat{display:block;left:12px;top:11px;width:24px;height:9px;border-radius:12px 12px 5px 5px;background:#2563eb;z-index:7}
.tug-character[data-accessory='cap'] .tug-hat::after{content:'';position:absolute;right:-5px;top:3px;width:10px;height:5px;border-radius:0 6px 6px 0;background:#1d4ed8}
.tug-character[data-accessory='satchel'] .tug-satchel{display:block;left:22px;top:44px;width:10px;height:12px;border-radius:3px;background:#854d0e;z-index:6}
.tug-character[data-accessory='satchel'] .tug-satchel::before{content:'';position:absolute;left:-6px;top:-4px;width:18px;height:2px;background:#854d0e;transform:rotate(-36deg);transform-origin:left center}
.tug-character[data-accessory='headband2'] .tug-band{height:6px;background:linear-gradient(90deg,#fb7185,#f43f5e)}
.tug-character[data-accessory='headband'] .tug-band::after{content:'';position:absolute;right:-1px;top:4px;width:6px;height:10px;background:var(--team-color);border-radius:0 0 5px 5px;transform:rotate(18deg)}

@keyframes tugIdle{0%,100%{transform:translateX(-50%) scaleX(var(--flip)) translateY(0) rotate(0deg)}50%{transform:translateX(-50%) scaleX(var(--flip)) translateY(-1px) rotate(-1deg)}}
@keyframes tugReady{0%{transform:translateX(-50%) scaleX(var(--flip)) translateY(0) rotate(0deg)}100%{transform:translateX(-50%) scaleX(var(--flip)) translateY(1px) rotate(-6deg)}}
@keyframes tugPull{0%,100%{transform:translateX(-50%) scaleX(var(--flip)) translateX(0) translateY(0) rotate(0deg)}25%{transform:translateX(-50%) scaleX(var(--flip)) translateX(-3px) translateY(1px) rotate(8deg)}55%{transform:translateX(-50%) scaleX(var(--flip)) translateX(2px) translateY(-1px) rotate(-7deg)}80%{transform:translateX(-50%) scaleX(var(--flip)) translateX(-1px) translateY(0) rotate(4deg)}}
@keyframes tugPower{0%,100%{transform:translateX(-50%) scaleX(var(--flip)) translateX(0) translateY(0) rotate(0deg)}35%{transform:translateX(-50%) scaleX(var(--flip)) translateX(-6px) translateY(2px) rotate(15deg)}65%{transform:translateX(-50%) scaleX(var(--flip)) translateX(4px) translateY(-2px) rotate(-10deg)}}
@keyframes tugDust{0%,100%{transform:translateY(0);opacity:.2}50%{transform:translateY(-1px);opacity:.65}}
@keyframes tugPop{0%{opacity:0;transform:translate(-50%,10px) scale(.8)}18%{opacity:1;transform:translate(-50%,-2px) scale(1)}100%{opacity:0;transform:translate(-50%,-18px) scale(1.05)}}

@media(max-width:900px){.tug-avatar-picker{grid-template-columns:repeat(3,minmax(0,1fr))}.tug-player-team>div,.tug-live-avatars>span{gap:8px}.tug-world{grid-template-columns:1fr;gap:10px;min-height:320px}.tug-player-rope{order:2}.tug-player-team.red{order:1}.tug-player-team.blue{order:3}}
@media(max-width:620px){.tug-avatar-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.tug-avatar-choice{min-height:132px}.tug-player-chip{grid-template-columns:auto 1fr}.tug-chip-controls{grid-column:1/-1;justify-content:flex-end}.tug-live-avatars{min-height:106px}.tug-character{max-width:68px}.tug-character-name{font-size:.6rem}.tug-character-meta{font-size:.57rem}.tug-score-avatar{width:56px;height:70px}}

/* Semi-realistic tug-of-war upgrade */
.tug-lobby,.tug-teacher-live{background:
  radial-gradient(circle at 50% -10%,rgba(255,255,255,.85),transparent 38%),
  linear-gradient(180deg,#173556 0%,#244c73 12%,#eef5ff 12%,#f8fbff 100%)}
.tug-room-code,.tug-teacher-head>div:last-child>span{box-shadow:0 10px 24px rgba(9,30,66,.08)}
.tug-lobby-copy h2,.tug-teacher-head h2{font-size:clamp(1.55rem,2vw,2rem)}
.tug-teacher-arena{padding:24px;border:1px solid rgba(205,220,236,.95);border-radius:24px;background:
  linear-gradient(180deg,rgba(255,255,255,.92) 0 46%,rgba(230,240,251,.92) 46% 62%,rgba(214,231,184,.97) 62% 100%);
  box-shadow:0 24px 48px rgba(18,41,76,.13)}
.tug-arena-score{padding:14px 10px;border-radius:18px;background:rgba(255,255,255,.72);backdrop-filter:blur(4px);box-shadow:0 12px 24px rgba(18,41,76,.08)}
.tug-arena-score.red{border:1px solid rgba(223,75,84,.2)}
.tug-arena-score.blue{border:1px solid rgba(61,130,230,.2)}
.tug-live-avatars>span{padding:10px 6px 0;min-height:138px;border-radius:18px;background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,0));position:relative}
.tug-live-avatars>span::after{content:'';position:absolute;left:10px;right:10px;bottom:8px;height:10px;border-radius:999px;background:radial-gradient(ellipse at center,rgba(93,106,42,.28),rgba(93,106,42,0) 70%)}
.tug-player-team>div{padding:10px 6px 4px;border-radius:18px;background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,0));position:relative}
.tug-player-team>div::after{content:'';position:absolute;left:10px;right:10px;bottom:4px;height:12px;border-radius:999px;background:radial-gradient(ellipse at center,rgba(96,111,46,.28),rgba(96,111,46,0) 72%)}
.tug-player-team.red>span,.tug-arena-score.red span{letter-spacing:.16em}
.tug-player-team.blue>span,.tug-arena-score.blue span{letter-spacing:.16em}

.tug-rope-wrap,.tug-player-rope{position:relative}
.tug-rope-line{position:relative;height:18px;margin:10px 0 16px;border-radius:999px;
  background:
   linear-gradient(180deg,rgba(255,255,255,.35),rgba(255,255,255,0) 35%),
   repeating-linear-gradient(90deg,#d6b178 0 12px,#b98245 12px 24px,#d0a56f 24px 36px,#a77039 36px 48px);
  background-blend-mode:screen,normal;
  box-shadow:inset 0 2px 2px rgba(255,255,255,.26),inset 0 -3px 4px rgba(102,59,24,.32),0 8px 12px rgba(60,40,21,.18)}
.tug-rope-line::before{content:'';position:absolute;inset:3px 0 auto;height:4px;border-radius:999px;background:rgba(255,255,255,.18)}
.tug-rope-line::after{content:'';position:absolute;left:4%;right:4%;bottom:-12px;height:8px;border-radius:999px;background:radial-gradient(ellipse at center,rgba(49,35,21,.12),rgba(49,35,21,0) 70%)}
.tug-rope-knot{width:28px;height:48px;font-size:0;transform:translate(-50%,-56%);filter:drop-shadow(0 4px 3px rgba(54,28,10,.22))}
.tug-rope-knot::before{content:'';position:absolute;left:50%;top:4px;width:12px;height:18px;border-radius:10px 10px 4px 4px;background:linear-gradient(180deg,#df4b54,#b92632);transform:translateX(-50%)}
.tug-rope-knot::after{content:'';position:absolute;left:50%;top:18px;width:22px;height:24px;background:linear-gradient(180deg,#ef5965,#b92632);clip-path:polygon(50% 0,100% 20%,72% 100%,50% 78%,28% 100%,0 20%);transform:translateX(-50%)}
.tug-finish,.tug-center{top:-16px;height:48px;width:4px}
.tug-finish.red{left:1%;background:linear-gradient(180deg,#ff7f88,#cf2f3b)}
.tug-finish.blue{right:1%;background:linear-gradient(180deg,#8dc2ff,#2d78de)}
.tug-center{background:linear-gradient(180deg,#9ca3af,#64748b);opacity:.55}

.tug-world{align-items:end;min-height:360px;padding:30px 26px;background:
  radial-gradient(circle at 50% 0,rgba(255,255,255,.88),transparent 28%),
  linear-gradient(180deg,#2a5279 0 12%,#e9f4ff 12% 57%,#d3e5f7 57% 65%,#c1dc96 65% 100%);
  border-top:1px solid rgba(210,226,242,.95)}
.tug-player-rope{padding-bottom:26px}
.tug-player-status{font-size:1rem}
body.theme-rgb .tug-teacher-arena{background:linear-gradient(180deg,rgba(14,26,42,.92) 0 46%,rgba(18,37,57,.92) 46% 62%,rgba(11,37,28,.94) 62% 100%);border-color:#335171;box-shadow:0 24px 48px rgba(0,0,0,.28)}
body.theme-rgb .tug-arena-score{background:rgba(16,31,53,.72);border-color:#37567d;box-shadow:0 12px 24px rgba(0,0,0,.22)}
body.theme-rgb .tug-live-avatars>span::after,body.theme-rgb .tug-player-team>div::after{background:radial-gradient(ellipse at center,rgba(28,88,61,.42),rgba(28,88,61,0) 72%)}
body.theme-rgb .tug-rope-line{background:
   linear-gradient(180deg,rgba(255,255,255,.2),rgba(255,255,255,0) 35%),
   repeating-linear-gradient(90deg,#d4b07a 0 12px,#b1793f 12px 24px,#c79965 24px 36px,#9c6936 36px 48px)}
body.theme-rgb .tug-world{background:radial-gradient(circle at 50% 0,rgba(90,141,196,.12),transparent 26%),linear-gradient(180deg,#071321 0 13%,#112338 13% 57%,#153149 57% 65%,#0f2e20 65% 100%)!important}

.tug-character{--scale:1;--body-outline:rgba(28,37,51,.22);--shoe:#1f2937;gap:5px;min-width:84px;max-width:94px}
.tug-character.compact{--scale:.86;min-width:62px;max-width:70px}
.tug-character.mini{--scale:.72;min-width:54px;max-width:62px}
.tug-character-stage{width:calc(70px * var(--scale));height:calc(118px * var(--scale))}
.tug-character-body{width:calc(60px * var(--scale));height:calc(108px * var(--scale));animation:tugIdleReal 2.35s ease-in-out infinite}
.tug-character.state-ready .tug-character-body{animation:tugBrace 1.1s ease-in-out infinite alternate}
.tug-character.state-pull .tug-character-body,.tug-character.state-hold .tug-character-body{animation:tugPullReal 1s cubic-bezier(.4,.0,.2,1) infinite}
.tug-character.pulse-pull .tug-character-body{animation:tugPowerReal .62s ease-in-out 2}
.tug-character.pulse-power .tug-character-body{animation:tugPowerReal .46s ease-in-out 3}
.tug-shadow{left:14px;bottom:2px;width:34px;height:8px;background:rgba(39,50,28,.18)}
.tug-rope-link{right:-3px;top:57px;width:24px;height:6px;border-radius:999px;background:repeating-linear-gradient(90deg,#d6b178 0 6px,#b98245 6px 12px);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 1px rgba(0,0,0,.18)}
.tug-leg{bottom:10px;width:12px;height:36px;border-radius:12px;background:linear-gradient(180deg,var(--pants),color-mix(in srgb,var(--pants) 65%, black));box-shadow:inset 0 -2px 0 rgba(255,255,255,.06)}
.tug-leg.back{left:18px;transform:rotate(10deg)}
.tug-leg.front{left:32px;transform:rotate(-8deg)}
.tug-leg::after{content:'';position:absolute;left:-3px;bottom:-4px;width:18px;height:8px;border-radius:8px 10px 5px 5px;background:var(--shoe);box-shadow:0 1px 0 rgba(255,255,255,.12) inset}
.tug-torso{left:15px;top:42px;width:30px;height:33px;border-radius:14px 14px 12px 12px;background:linear-gradient(180deg,color-mix(in srgb,var(--shirt) 88%, white) 0%,var(--shirt) 52%,color-mix(in srgb,var(--shirt) 75%, black) 100%);box-shadow:0 0 0 1px var(--body-outline),inset 0 -5px 0 rgba(0,0,0,.08),inset 0 4px 0 rgba(255,255,255,.16)}
.tug-torso::before{content:'';position:absolute;left:50%;top:5px;width:14px;height:4px;border-radius:999px;background:rgba(255,255,255,.25);transform:translateX(-50%)}
.tug-arm{top:46px;width:10px;height:33px;border-radius:12px;background:linear-gradient(180deg,var(--skin),color-mix(in srgb,var(--skin) 78%, #8b5e3c));box-shadow:0 0 0 1px rgba(82,56,34,.08);z-index:1}
.tug-arm.back{left:14px;transform:rotate(52deg)}
.tug-arm.front{left:38px;transform:rotate(-68deg)}
.tug-arm::after{content:'';position:absolute;bottom:-1px;left:-1px;width:12px;height:8px;border-radius:6px;background:var(--skin)}
.tug-head{left:18px;top:17px;width:24px;height:28px;border-radius:48% 48% 44% 44%;background:linear-gradient(180deg,color-mix(in srgb,var(--skin) 92%, white),var(--skin) 68%,color-mix(in srgb,var(--skin) 80%, #8b5e3c));z-index:3;box-shadow:0 0 0 1px rgba(82,56,34,.08)}
.tug-face{left:23px;top:28px;width:12px;height:10px;z-index:4}
.tug-face::before{left:1px;top:1px;width:2px;height:2px;background:#1f2937;box-shadow:7px 0 0 #1f2937}
.tug-face::after{left:2px;top:6px;width:7px;height:2px;border-bottom:2px solid #7c2d12;border-radius:0 0 8px 8px}
.tug-band{left:17px;top:22px;width:27px;height:6px;background:var(--team-color);border-radius:999px;z-index:6;box-shadow:0 0 0 1px rgba(255,255,255,.35) inset,0 1px 2px rgba(0,0,0,.12)}
.tug-hair{left:16px;top:15px;width:28px;height:14px;border-radius:14px 14px 8px 8px;background:linear-gradient(180deg,color-mix(in srgb,var(--hair) 85%, white),var(--hair));z-index:7}
.tug-dust{left:10px;bottom:0;width:40px;height:13px}
.tug-dust::before,.tug-dust::after{width:11px;height:6px;background:rgba(137,110,60,.35)}
.tug-character[data-accessory='ponytail'] .tug-hair::after{right:1px;top:10px;width:9px;height:16px;border-radius:0 0 8px 8px;background:linear-gradient(180deg,color-mix(in srgb,var(--hair) 85%, white),var(--hair))}
.tug-character[data-accessory='hood'] .tug-hood{left:12px;top:16px;width:35px;height:32px;border-width:5px}
.tug-character[data-accessory='headphones'] .tug-headphones{left:13px;top:15px;width:32px;height:20px;border-width:3px}
.tug-character[data-accessory='mask'] .tug-mask{left:22px;top:31px;width:16px;height:8px}
.tug-character[data-accessory='helmet'] .tug-helmet{left:13px;top:12px;width:34px;height:24px}
.tug-character[data-accessory='robot'] .tug-head{left:17px;top:16px;width:26px;height:26px;border-radius:8px}
.tug-character[data-accessory='wizard'] .tug-hat{left:12px;top:0;border-left-width:16px;border-right-width:10px;border-bottom-width:28px}
.tug-character[data-accessory='wizard'] .tug-hat::after{left:-16px;top:26px;width:27px;height:7px}
.tug-character[data-accessory='cap'] .tug-hat{left:15px;top:16px;width:28px;height:10px}
.tug-character[data-accessory='satchel'] .tug-satchel{left:27px;top:55px;width:11px;height:14px}
.tug-character-name{font-size:.69rem;text-shadow:0 1px 0 rgba(255,255,255,.5)}
.tug-character-meta{font-size:.63rem;font-weight:800}
.tug-character-pop{top:0;padding:4px 8px;background:#fff;border-color:rgba(23,24,33,.1);box-shadow:0 10px 20px rgba(17,24,39,.15)}
body.theme-rgb .tug-character-pop{background:#10243d;border-color:#315170;color:#ffd166}

@keyframes tugIdleReal{0%,100%{transform:translateX(-50%) scaleX(var(--flip)) translateY(0) rotate(0deg)}50%{transform:translateX(-50%) scaleX(var(--flip)) translateY(-1px) rotate(-1.25deg)}}
@keyframes tugBrace{0%{transform:translateX(-50%) scaleX(var(--flip)) translateX(0) translateY(0) rotate(-2deg)}100%{transform:translateX(-50%) scaleX(var(--flip)) translateX(-1px) translateY(1px) rotate(-10deg)}}
@keyframes tugPullReal{0%,100%{transform:translateX(-50%) scaleX(var(--flip)) translateX(0) rotate(-1deg)}22%{transform:translateX(-50%) scaleX(var(--flip)) translateX(-6px) translateY(1px) rotate(11deg)}48%{transform:translateX(-50%) scaleX(var(--flip)) translateX(3px) translateY(-2px) rotate(-12deg)}72%{transform:translateX(-50%) scaleX(var(--flip)) translateX(-3px) rotate(7deg)}}
@keyframes tugPowerReal{0%,100%{transform:translateX(-50%) scaleX(var(--flip)) translateX(0) rotate(0deg)}33%{transform:translateX(-50%) scaleX(var(--flip)) translateX(-10px) translateY(2px) rotate(16deg)}64%{transform:translateX(-50%) scaleX(var(--flip)) translateX(5px) translateY(-3px) rotate(-13deg)}}

@media(max-width:900px){.tug-world{min-height:390px;padding:22px 16px}.tug-character{min-width:72px;max-width:78px}.tug-live-avatars>span{min-height:126px}}
@media(max-width:620px){.tug-teacher-arena{padding:18px}.tug-world{min-height:350px}.tug-character{min-width:62px;max-width:70px}.tug-character-stage{width:calc(58px * var(--scale));height:calc(104px * var(--scale))}.tug-character-body{width:calc(54px * var(--scale));height:calc(98px * var(--scale))}.tug-score-avatar{width:58px;height:72px}.tug-live-avatars>span,.tug-player-team>div{min-height:118px}}

/* --- Asset-based semi-realistic Tug of War rebuild --- */
.tug-avatar-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.tug-avatar-choice{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:14px 10px;border-radius:22px;min-height:198px;background:linear-gradient(180deg,#ffffff,#f1f6fb);border:1px solid #d7e3ef;box-shadow:0 8px 20px rgba(16,42,67,.08)}
.tug-avatar-choice:hover{transform:translateY(-2px);box-shadow:0 14px 28px rgba(16,42,67,.12)}
.tug-avatar-choice.selected{border-color:#3b82f6;box-shadow:0 0 0 4px rgba(59,130,246,.16),0 16px 30px rgba(16,42,67,.14)}
.tug-avatar-choice-label{font-size:.78rem;font-weight:800;color:#1e3a5f;line-height:1.2}

.tug-lobby,.tug-teacher-live{background:linear-gradient(180deg,#274b73 0 18px,#f7fbff 18px 100%);border-radius:28px;overflow:hidden;box-shadow:0 18px 38px rgba(13,36,60,.12)}
.tug-room-code{background:linear-gradient(180deg,#fff,#edf6ff)}
.tug-lobby-copy{padding:8px 4px 6px}
.tug-player-chip{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px 14px;border-radius:20px;background:linear-gradient(180deg,#fff,#f3f7fc);box-shadow:0 10px 20px rgba(15,23,42,.06)}
.tug-chip-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.tug-chip-info strong{color:#17395b;font-size:.96rem}
.tug-chip-info span{font-size:.73rem;font-weight:700;color:#6d7d90;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tug-lobby-team h3,.tug-score-team h3{display:inline-flex;align-items:center;gap:8px;padding:10px 18px;border-radius:999px;color:#fff;letter-spacing:.08em;font-size:.88rem;font-weight:900;text-transform:uppercase;box-shadow:0 8px 20px rgba(17,24,39,.15)}
.tug-lobby-team.red h3,.tug-score-team.red h3{background:linear-gradient(180deg,#ef5965,#c92c38)}
.tug-lobby-team.blue h3,.tug-score-team.blue h3{background:linear-gradient(180deg,#58a3ff,#266dd4)}
.tug-lobby-team.unassigned h3{background:linear-gradient(180deg,#9aa7b5,#68778a)}

.tug-teacher-head{padding:18px 22px;color:#fff;background:linear-gradient(90deg,#214c7c,#173556)}
.tug-teacher-head span{color:#d4e6fb}
.tug-teacher-head h2{color:#fff}
.tug-teacher-arena{position:relative;padding:28px 22px 24px;border-radius:0;background:linear-gradient(180deg,#dbedf9 0 55%,#c8dff1 55% 66%,#bbd692 66% 100%)}
.tug-teacher-arena::before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 50% 0,rgba(255,255,255,.6),transparent 36%);pointer-events:none}
.tug-live-avatars{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:end;position:relative;z-index:2}
.tug-live-avatars>span{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:4px;min-height:184px;padding:10px 0 6px}
.tug-world{position:relative;display:grid;grid-template-columns:minmax(200px,1fr) minmax(340px,1.2fr) minmax(200px,1fr);gap:8px;align-items:end;min-height:410px;padding:28px 22px 16px;background:linear-gradient(180deg,#dbedf9 0 55%,#c8dff1 55% 66%,#bbd692 66% 100%)}
.tug-world::before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 50% 0,rgba(255,255,255,.55),transparent 34%);pointer-events:none}
.tug-player-team{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;gap:8px}
.tug-player-team>span{display:inline-flex;align-items:center;justify-content:center;min-width:150px;padding:10px 16px;border-radius:16px 16px 8px 8px;color:#fff;font-weight:900;letter-spacing:.12em;text-transform:uppercase;box-shadow:0 10px 24px rgba(17,24,39,.16)}
.tug-player-team.red>span{background:linear-gradient(180deg,#ef5965,#c92c38)}
.tug-player-team.blue>span{background:linear-gradient(180deg,#58a3ff,#266dd4)}
.tug-player-team>div{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:4px;min-height:210px;width:100%;padding:0 6px 6px}
.tug-player-team>div::after,.tug-live-avatars>span::after{content:'';position:absolute;left:8%;right:8%;bottom:4px;height:12px;border-radius:999px;background:radial-gradient(ellipse at center,rgba(77,102,44,.26),rgba(77,102,44,0) 70%)}
.tug-player-team>div,.tug-live-avatars>span{position:relative}
.tug-player-rope{position:relative;z-index:2;padding-bottom:34px}
.tug-player-rope p{margin-top:12px;font-size:.98rem;font-weight:800;color:#17395b;text-align:center}

.tug-rope-wrap{display:flex;flex-direction:column;justify-content:flex-end;min-height:240px}
.tug-rope-line{position:relative;height:18px;margin:0 8px 18px;border-radius:999px;background:linear-gradient(180deg,rgba(255,255,255,.3),rgba(255,255,255,0) 35%),repeating-linear-gradient(90deg,#d4b07a 0 14px,#b47a3d 14px 28px,#d6b27d 28px 42px,#a56b34 42px 56px);box-shadow:inset 0 2px 2px rgba(255,255,255,.3),inset 0 -3px 4px rgba(92,55,25,.32),0 8px 18px rgba(79,57,35,.16)}
.tug-rope-line::before{content:'';position:absolute;inset:3px 0 auto;height:4px;border-radius:999px;background:rgba(255,255,255,.18)}
.tug-rope-knot{position:absolute;top:50%;left:50%;display:block;width:24px;height:54px;font-size:0;transform:translate(-50%,-58%)}
.tug-rope-knot::before{content:'';position:absolute;left:50%;top:4px;width:12px;height:16px;border-radius:8px 8px 4px 4px;background:linear-gradient(180deg,#ef5965,#c92c38);transform:translateX(-50%)}
.tug-rope-knot::after{content:'';position:absolute;left:50%;top:18px;width:26px;height:30px;background:linear-gradient(180deg,#ef5965,#c92c38);clip-path:polygon(50% 0,100% 18%,72% 100%,50% 78%,28% 100%,0 18%);transform:translateX(-50%);filter:drop-shadow(0 4px 6px rgba(71,19,28,.2))}
.tug-finish,.tug-center{position:absolute;top:-15px;width:4px;height:48px;border-radius:999px}
.tug-finish.red{left:1.5%;background:linear-gradient(180deg,#ff7d87,#ca2e39)}
.tug-finish.blue{right:1.5%;background:linear-gradient(180deg,#8dc3ff,#276cd1)}
.tug-center{left:50%;transform:translateX(-50%);background:linear-gradient(180deg,#8aa0b8,#677d94);opacity:.55}

.tug-character{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;min-width:96px;max-width:122px}
.tug-character.compact{min-width:72px;max-width:90px}
.tug-character.mini{min-width:58px;max-width:72px}
.tug-character-stage{position:relative;display:block;width:100%}
.tug-avatar-art{display:block;width:100%;height:auto;transform-origin:40% 82%;filter:drop-shadow(0 10px 12px rgba(14,35,59,.15));user-select:none;pointer-events:none}
.tug-character.facing-left .tug-avatar-art{transform:scaleX(-1)}
.tug-character.state-idle .tug-avatar-art{animation:tugIdleAsset 2.4s ease-in-out infinite}
.tug-character.state-ready .tug-avatar-art{animation:tugBraceAsset .95s ease-in-out infinite alternate}
.tug-character.state-pull .tug-avatar-art,.tug-character.state-hold .tug-avatar-art{animation:tugPullAsset .95s ease-in-out infinite}
.tug-character.pulse-pull .tug-avatar-art{animation:tugPowerAsset .55s ease-in-out 2}
.tug-character.pulse-power .tug-avatar-art{animation:tugPowerAsset .42s ease-in-out 3}
.tug-character-name{font-size:.68rem;font-weight:900;color:#17395b;line-height:1.1;text-align:center;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 0 rgba(255,255,255,.45)}
.tug-character-meta{font-size:.62rem;font-weight:800;color:#66778d;line-height:1.1;text-align:center}
.tug-character.is-me .tug-character-name{color:#8a4b00}
.tug-character-pop{position:absolute;left:50%;top:-4px;transform:translateX(-50%);padding:4px 8px;border-radius:999px;background:#fff;color:#8d2331;border:1px solid rgba(15,23,42,.08);font-size:.58rem;font-weight:900;white-space:nowrap;box-shadow:0 8px 20px rgba(15,23,42,.12);animation:tugPopAsset .95s ease-out forwards;z-index:2}
.tug-character.pulse-power .tug-character-pop{background:#fff4be;color:#935602}

.tug-scoreboard{padding:16px 20px 24px}
.tug-score-team{background:linear-gradient(180deg,#fff,#f4f8fd);border:1px solid #d6e3ef;border-radius:24px;padding:16px;box-shadow:0 14px 28px rgba(17,24,39,.06)}
.tug-score-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 12px;border-radius:18px;background:#fff;border:1px solid #e4edf5}
.tug-score-avatar{display:flex;align-items:flex-end;justify-content:center;width:82px;height:88px;border-radius:16px;background:linear-gradient(180deg,#fbfdff,#eef5fb)}
.tug-score-metrics b{color:#17395b}

body.theme-rgb .tug-lobby,body.theme-rgb .tug-teacher-live{background:linear-gradient(180deg,#10253f 0 18px,#0f2035 18px 100%);box-shadow:0 18px 38px rgba(0,0,0,.26)}
body.theme-rgb .tug-room-code,body.theme-rgb .tug-avatar-choice,body.theme-rgb .tug-player-chip,body.theme-rgb .tug-score-team,body.theme-rgb .tug-score-card{background:linear-gradient(180deg,#132842,#0d1e32);border-color:#294765;box-shadow:none}
body.theme-rgb .tug-avatar-choice-label,body.theme-rgb .tug-chip-info strong,body.theme-rgb .tug-character-name,body.theme-rgb .tug-score-metrics b,body.theme-rgb .tug-player-rope p{color:#eef4ff}
body.theme-rgb .tug-chip-info span,body.theme-rgb .tug-character-meta{color:#9db1c8}
body.theme-rgb .tug-teacher-head{background:linear-gradient(90deg,#0a1b2c,#0f2f4d)}
body.theme-rgb .tug-teacher-arena,body.theme-rgb .tug-world{background:linear-gradient(180deg,#10253f 0 55%,#153149 55% 66%,#103020 66% 100%)}
body.theme-rgb .tug-avatar-choice.selected{box-shadow:0 0 0 4px rgba(59,130,246,.25)}
body.theme-rgb .tug-score-avatar{background:linear-gradient(180deg,#152d49,#102036)}
body.theme-rgb .tug-character-pop{background:#10243d;border-color:#335171;color:#ffd166}
body.theme-rgb .tug-player-team>div::after,body.theme-rgb .tug-live-avatars>span::after{background:radial-gradient(ellipse at center,rgba(28,88,61,.38),rgba(28,88,61,0) 72%)}

@keyframes tugIdleAsset{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-1px) rotate(-1deg)}}
@keyframes tugBraceAsset{0%{transform:translateY(0) rotate(-1deg)}100%{transform:translate(-2px,1px) rotate(-4deg)}}
@keyframes tugPullAsset{0%,100%{transform:translate(0,0) rotate(0deg)}22%{transform:translate(-6px,1px) rotate(5deg)}48%{transform:translate(3px,-2px) rotate(-3deg)}74%{transform:translate(-2px,0) rotate(2deg)}}
@keyframes tugPowerAsset{0%,100%{transform:translate(0,0) rotate(0deg)}33%{transform:translate(-10px,2px) rotate(8deg)}65%{transform:translate(4px,-2px) rotate(-5deg)}}
@keyframes tugPopAsset{0%{opacity:0;transform:translate(-50%,10px) scale(.85)}16%{opacity:1;transform:translate(-50%,0) scale(1)}100%{opacity:0;transform:translate(-50%,-18px) scale(1.06)}}

@media(max-width:1000px){.tug-avatar-picker{grid-template-columns:repeat(4,minmax(0,1fr))}.tug-world{grid-template-columns:1fr;gap:12px;min-height:450px}.tug-player-rope{order:2}.tug-player-team.red{order:1}.tug-player-team.blue{order:3}}
@media(max-width:760px){.tug-avatar-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.tug-live-avatars{grid-template-columns:1fr}.tug-live-avatars>span{min-height:156px}.tug-character{min-width:82px;max-width:98px}.tug-character.compact{min-width:64px;max-width:78px}.tug-character.mini{min-width:52px;max-width:64px}.tug-score-card{grid-template-columns:auto 1fr}.tug-score-metrics{grid-column:1/-1;padding-left:94px}}
@media(max-width:520px){.tug-avatar-choice{min-height:168px}.tug-player-chip{grid-template-columns:auto 1fr}.tug-chip-controls{grid-column:1/-1;justify-content:flex-end}.tug-player-team>div{min-height:172px}.tug-world{min-height:390px;padding:24px 14px 14px}.tug-score-avatar{width:72px;height:80px}}

/* Root-level avatar asset fallback */
.tug-character-stage.asset-missing{display:grid;place-items:center;min-height:120px;border-radius:18px;background:linear-gradient(180deg,#eaf3fb,#d9e8f5)}
.tug-avatar-fallback{display:grid;place-items:center;width:74px;height:94px;border-radius:28px 28px 22px 22px;background:linear-gradient(180deg,#7da1c2,#516e8d);color:#fff;font-size:1rem;font-weight:900;letter-spacing:.08em;box-shadow:inset 0 0 0 1px rgba(255,255,255,.25),0 10px 20px rgba(19,43,68,.12)}
body.theme-rgb .tug-character-stage.asset-missing{background:linear-gradient(180deg,#17304e,#102339)}


/* Final anime avatar rebuild overrides */
.tug-avatar-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.tug-avatar-choice{min-height:286px;padding:16px 12px 12px;justify-content:space-between;border-radius:22px;border:1px solid #2a4f7a;background:linear-gradient(180deg,#173556,#132e4b);box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 10px 24px rgba(10,29,51,.18)}
.tug-avatar-choice:hover{transform:translateY(-2px);border-color:#4e86c6}
.tug-avatar-choice.selected{border-color:#62a8ff;box-shadow:0 0 0 3px rgba(98,168,255,.24),0 14px 28px rgba(10,29,51,.24)}
.tug-avatar-choice .tug-character.compact{min-width:100%;max-width:none;gap:8px}
.tug-avatar-choice .tug-character.compact .tug-character-stage{display:flex;align-items:flex-end;justify-content:center;min-height:172px}
.tug-avatar-choice .tug-character.compact .tug-avatar-art{max-height:168px;width:auto;max-width:100%;height:auto;filter:drop-shadow(0 12px 18px rgba(4,12,22,.36))}
.tug-avatar-choice-label{font-size:.84rem;font-weight:800;color:#f3f8ff;line-height:1.2}

.tug-character{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;min-width:102px;max-width:136px}
.tug-character.compact{min-width:80px;max-width:98px}
.tug-character.mini{min-width:60px;max-width:72px}
.tug-character-stage{position:relative;display:flex;align-items:flex-end;justify-content:center;min-height:132px;width:100%}
.tug-avatar-art{display:block;width:auto;height:auto;max-width:100%;max-height:128px;transform-origin:50% 90%;filter:drop-shadow(0 10px 12px rgba(14,35,59,.18));user-select:none;pointer-events:none}
.tug-character.compact .tug-avatar-art{max-height:154px}
.tug-character.mini .tug-avatar-art{max-height:84px}
.tug-character.facing-left .tug-avatar-art{transform:scaleX(-1)}
.tug-character.state-idle .tug-avatar-art{animation:tugIdleAsset 2.4s ease-in-out infinite}
.tug-character.state-ready .tug-avatar-art{animation:tugBraceAsset .95s ease-in-out infinite alternate}
.tug-character.state-pull .tug-avatar-art,.tug-character.state-hold .tug-avatar-art{animation:tugPullAsset .95s ease-in-out infinite}
.tug-character.pulse-pull .tug-avatar-art,.tug-character.pulse-power .tug-avatar-art{animation:tugPowerAsset .48s ease-in-out 2}
.tug-character-name{font-size:.69rem;font-weight:900;color:#17395b;line-height:1.1;text-align:center;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 0 rgba(255,255,255,.45)}
.tug-character-meta{font-size:.62rem;font-weight:800;color:#66778d;line-height:1.1;text-align:center}
.tug-character-pop{position:absolute;left:50%;top:-4px;transform:translateX(-50%);padding:4px 8px;border-radius:999px;background:#fff;color:#8d2331;border:1px solid rgba(15,23,42,.08);font-size:.58rem;font-weight:900;white-space:nowrap;box-shadow:0 8px 20px rgba(15,23,42,.12);animation:tugPopAsset .95s ease-out forwards;z-index:2}

.tug-player-chip{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px 14px;border-radius:20px;background:linear-gradient(180deg,#fff,#f3f7fc);box-shadow:0 10px 20px rgba(15,23,42,.06)}
.tug-chip-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.tug-chip-info strong{color:#17395b;font-size:.96rem}.tug-chip-info span{font-size:.73rem;font-weight:700;color:#6d7d90;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tug-score-avatar{display:flex;align-items:flex-end;justify-content:center;width:92px;height:104px;border-radius:16px;background:linear-gradient(180deg,#fbfdff,#eef5fb)}
.tug-score-avatar .tug-character{min-width:86px;max-width:86px}.tug-score-avatar .tug-character-stage{min-height:96px}.tug-score-avatar .tug-avatar-art{max-height:92px}

body.theme-rgb .tug-avatar-choice{background:linear-gradient(180deg,#132842,#0d1e32);border-color:#294765;box-shadow:none}
body.theme-rgb .tug-avatar-choice-label,body.theme-rgb .tug-chip-info strong,body.theme-rgb .tug-character-name{color:#eef4ff}
body.theme-rgb .tug-chip-info span,body.theme-rgb .tug-character-meta{color:#9db1c8}
body.theme-rgb .tug-score-avatar{background:linear-gradient(180deg,#152d49,#102036)}
body.theme-rgb .tug-character-pop{background:#10243d;border-color:#335171;color:#ffd166}
body.theme-rgb .tug-character-stage.asset-missing{background:linear-gradient(180deg,#17304e,#102339)}
body.theme-rgb .tug-avatar-fallback{background:linear-gradient(180deg,#173352,#10243b);color:#eef4ff}

.tug-avatar-fallback{display:inline-flex;align-items:center;justify-content:center;width:72px;height:72px;border-radius:999px;background:linear-gradient(180deg,#eef5ff,#cfe1f7);color:#17395b;font-weight:900;letter-spacing:.08em;box-shadow:inset 0 0 0 1px rgba(23,57,91,.1)}
.tug-character-stage.asset-missing{display:grid;place-items:center;min-height:120px;border-radius:18px;background:linear-gradient(180deg,#eaf3fb,#d9e8f5)}

@keyframes tugIdleAsset{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-1px) rotate(-1deg)}}
@keyframes tugBraceAsset{0%{transform:translateY(0) rotate(-1deg)}100%{transform:translate(-2px,1px) rotate(-4deg)}}
@keyframes tugPullAsset{0%,100%{transform:translate(0,0) rotate(0deg)}22%{transform:translate(-6px,1px) rotate(5deg)}48%{transform:translate(3px,-2px) rotate(-3deg)}74%{transform:translate(-2px,0) rotate(2deg)}}
@keyframes tugPowerAsset{0%,100%{transform:translate(0,0) rotate(0deg)}33%{transform:translate(-10px,2px) rotate(8deg)}65%{transform:translate(4px,-2px) rotate(-5deg)}}
@keyframes tugPopAsset{0%{opacity:0;transform:translate(-50%,10px) scale(.85)}16%{opacity:1;transform:translate(-50%,0) scale(1)}100%{opacity:0;transform:translate(-50%,-18px) scale(1.06)}}

@media(max-width:760px){.tug-avatar-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.tug-avatar-choice{min-height:252px}.tug-avatar-choice .tug-character.compact .tug-character-stage{min-height:146px}.tug-avatar-choice .tug-character.compact .tug-avatar-art{max-height:142px}.tug-character{min-width:88px;max-width:106px}.tug-character .tug-avatar-art{max-height:110px}}
@media(max-width:520px){.tug-avatar-choice{min-height:236px;padding:12px 10px}.tug-avatar-choice-label{font-size:.76rem}.tug-character.compact .tug-avatar-art{max-height:132px}}


/* Rope integration rebuild overrides */
.tug-teacher-arena{grid-template-columns:140px minmax(420px,1fr) 140px;align-items:end;gap:12px;padding:22px 18px 16px;overflow:hidden}
.tug-arena-score{position:relative;z-index:4;align-self:center}
.tug-rope-wrap{position:relative;display:flex;flex-direction:column;justify-content:flex-start;min-height:270px;padding-top:78px}
.tug-teacher-arena .tug-rope-wrap{margin-top:-4px}
.tug-rope-wrap .tug-rope-line{position:relative;z-index:1;width:calc(100% + 340px);margin:0 0 0 -170px;height:20px;border-radius:999px;background:
  linear-gradient(180deg,rgba(255,255,255,.32),rgba(255,255,255,0) 35%),
  repeating-linear-gradient(90deg,#d6b178 0 16px,#b57a3c 16px 32px,#dfbc89 32px 48px,#a66b33 48px 64px);
  box-shadow:inset 0 2px 2px rgba(255,255,255,.28),inset 0 -3px 5px rgba(84,53,24,.34),0 10px 18px rgba(60,38,16,.18)}
.tug-rope-wrap .tug-rope-line::before{content:'';position:absolute;inset:3px 0 auto;height:5px;border-radius:999px;background:rgba(255,255,255,.18)}
.tug-rope-wrap .tug-rope-line::after{content:'';position:absolute;left:5%;right:5%;bottom:-14px;height:10px;border-radius:999px;background:radial-gradient(ellipse at center,rgba(57,39,17,.14),rgba(57,39,17,0) 72%)}
.tug-rope-wrap .tug-rope-knot{position:absolute;top:50%;left:50%;z-index:3;width:26px;height:58px;font-size:0;transform:translate(-50%,-55%);filter:drop-shadow(0 4px 6px rgba(69,20,28,.24))}
.tug-rope-wrap .tug-rope-knot::before{content:'';position:absolute;left:50%;top:3px;width:12px;height:18px;border-radius:10px 10px 4px 4px;background:linear-gradient(180deg,#f76570,#cc3340);transform:translateX(-50%)}
.tug-rope-wrap .tug-rope-knot::after{content:'';position:absolute;left:50%;top:18px;width:28px;height:34px;transform:translateX(-50%);background:linear-gradient(180deg,#f86873,#c92634);clip-path:polygon(50% 0,100% 18%,72% 100%,50% 78%,28% 100%,0 18%)}
.tug-rope-wrap .tug-finish,.tug-rope-wrap .tug-center{top:-16px;height:52px;width:4px;border-radius:999px}
.tug-rope-wrap .tug-finish.red{left:1.5%;background:linear-gradient(180deg,#ff7e88,#cb2d39)}
.tug-rope-wrap .tug-finish.blue{right:1.5%;background:linear-gradient(180deg,#92c4ff,#2f73da)}
.tug-rope-wrap .tug-center{left:50%;transform:translateX(-50%);background:linear-gradient(180deg,#93a7bc,#6d8198);opacity:.56}
.tug-live-avatars{position:absolute;left:0;right:0;bottom:4px;display:grid;grid-template-columns:1fr 1fr;gap:16px;z-index:4;pointer-events:none}
.tug-live-avatars>span{display:flex;align-items:flex-end;min-height:132px;padding:0 8px}
.tug-live-avatars>span:first-child{justify-content:flex-start;padding-left:18px}
.tug-live-avatars>span:last-child{justify-content:flex-end;padding-right:18px}
.tug-live-avatars>span .tug-character{min-width:118px;max-width:142px}
.tug-live-avatars>span .tug-character .tug-character-stage{min-height:134px}
.tug-live-avatars>span .tug-character .tug-avatar-art{max-height:130px}
.tug-live-avatars>span::after{left:12%;right:12%;bottom:4px;height:12px}
.tug-teacher-arena .tug-character.facing-right .tug-avatar-art{transform:translateX(10px)}
.tug-teacher-arena .tug-character.facing-left .tug-avatar-art{transform:scaleX(-1) translateX(10px)}
.tug-teacher-arena .tug-character.state-idle .tug-avatar-art{animation:tugIdleAsset 2.4s ease-in-out infinite}
.tug-teacher-arena .tug-character.state-ready .tug-avatar-art{animation:tugBraceAsset .95s ease-in-out infinite alternate}
.tug-teacher-arena .tug-character.state-pull .tug-avatar-art,.tug-teacher-arena .tug-character.state-hold .tug-avatar-art{animation:tugPullAsset .95s ease-in-out infinite}
.tug-teacher-arena .tug-character.pulse-pull .tug-avatar-art,.tug-teacher-arena .tug-character.pulse-power .tug-avatar-art{animation:tugPowerAsset .48s ease-in-out 2}
.tug-world{position:relative;grid-template-columns:minmax(220px,1fr) minmax(420px,1.25fr) minmax(220px,1fr);align-items:end;gap:8px;min-height:450px;padding:20px 20px 14px;overflow:hidden;background:
  radial-gradient(circle at 50% 6%,rgba(255,255,255,.64),transparent 34%),
  linear-gradient(180deg,#d8ecfb 0 58%,#c4ddef 58% 68%,#b7d18c 68% 100%)}
.tug-world::after{content:'';position:absolute;left:0;right:0;bottom:0;height:34%;background:linear-gradient(180deg,rgba(0,0,0,0),rgba(78,106,44,.04) 35%,rgba(71,99,39,.08));pointer-events:none}
.tug-player-team{position:relative;z-index:4;gap:10px}
.tug-player-team>span{min-width:164px;padding:11px 18px;border-radius:16px 16px 8px 8px;box-shadow:0 10px 24px rgba(17,24,39,.18)}
.tug-player-team>div{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px;min-height:250px;padding:0 18px 16px;background:none}
.tug-player-team.red>div{justify-content:flex-end;padding-right:32px}
.tug-player-team.blue>div{justify-content:flex-start;padding-left:32px}
.tug-player-team>div::after{left:18%;right:18%;bottom:10px;height:14px;background:radial-gradient(ellipse at center,rgba(74,99,42,.28),rgba(74,99,42,0) 72%)}
.tug-player-team .tug-character{min-width:132px;max-width:156px}
.tug-player-team .tug-character .tug-character-stage{min-height:176px}
.tug-player-team .tug-character .tug-avatar-art{max-height:170px}
.tug-player-rope{position:relative;z-index:2;display:flex;align-items:flex-end;justify-content:center;min-height:260px;padding-bottom:76px}
.tug-player-rope .tug-rope-wrap{width:100%;min-height:0;padding-top:0;justify-content:flex-end}
.tug-player-rope .tug-rope-line{width:calc(100% + 520px);margin-left:-260px;height:22px}
.tug-player-rope .tug-rope-knot{top:50%;transform:translate(-50%,-56%)}
.tug-player-rope p{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);margin:0;padding:8px 14px;border-radius:999px;background:rgba(255,255,255,.82);box-shadow:0 10px 20px rgba(17,24,39,.08);font-size:.95rem;white-space:nowrap;color:#17395b}
.tug-player-team.red .tug-character{transform:translateX(22px)}
.tug-player-team.blue .tug-character{transform:translateX(-22px)}
.tug-player-team.red .tug-character.facing-right .tug-avatar-art{transform:translateX(14px)}
.tug-player-team.blue .tug-character.facing-left .tug-avatar-art{transform:scaleX(-1) translateX(14px)}
.tug-player-team .tug-character.state-idle .tug-avatar-art{animation:tugIdleAsset 2.4s ease-in-out infinite}
.tug-player-team .tug-character.state-ready .tug-avatar-art{animation:tugBraceAsset .95s ease-in-out infinite alternate}
.tug-player-team .tug-character.state-pull .tug-avatar-art,.tug-player-team .tug-character.state-hold .tug-avatar-art{animation:tugPullAsset .95s ease-in-out infinite}
.tug-player-team .tug-character.pulse-pull .tug-avatar-art,.tug-player-team .tug-character.pulse-power .tug-avatar-art{animation:tugPowerAsset .48s ease-in-out 2}

body.theme-rgb .tug-teacher-arena{background:linear-gradient(180deg,#0f243c 0 57%,#123149 57% 68%,#0f301f 68% 100%)}
body.theme-rgb .tug-world{background:radial-gradient(circle at 50% 5%,rgba(113,170,234,.12),transparent 30%),linear-gradient(180deg,#0f233b 0 58%,#143149 58% 68%,#10301f 68% 100%)!important}
body.theme-rgb .tug-player-team>div::after,body.theme-rgb .tug-live-avatars>span::after{background:radial-gradient(ellipse at center,rgba(28,88,61,.42),rgba(28,88,61,0) 72%)}
body.theme-rgb .tug-player-rope p{background:rgba(16,36,61,.78);color:#eef4ff;box-shadow:0 10px 20px rgba(0,0,0,.2)}
body.theme-rgb .tug-rope-wrap .tug-rope-line{background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,0) 35%),repeating-linear-gradient(90deg,#d7b47f 0 16px,#b67c42 16px 32px,#dcb987 32px 48px,#9f6936 48px 64px)}

@media(max-width:1100px){.tug-player-rope .tug-rope-line{width:calc(100% + 420px);margin-left:-210px}.tug-live-avatars>span .tug-character{min-width:104px;max-width:126px}.tug-live-avatars>span .tug-character .tug-avatar-art{max-height:118px}.tug-player-team .tug-character{min-width:118px;max-width:140px}.tug-player-team .tug-character .tug-avatar-art{max-height:154px}}
@media(max-width:900px){.tug-teacher-arena{grid-template-columns:1fr;gap:12px;padding-bottom:12px}.tug-live-avatars{position:relative;bottom:auto;grid-template-columns:1fr 1fr;margin-top:-42px}.tug-rope-wrap{min-height:210px;padding-top:46px}.tug-rope-wrap .tug-rope-line{width:calc(100% + 220px);margin-left:-110px}.tug-world{grid-template-columns:1fr;gap:10px;min-height:500px;padding:20px 14px 12px}.tug-player-rope{order:2;min-height:180px;padding-bottom:54px}.tug-player-rope .tug-rope-line{width:calc(100% + 180px);margin-left:-90px}.tug-player-team.red{order:1}.tug-player-team.blue{order:3}.tug-player-team>div{min-height:190px;padding:0 8px 14px}.tug-player-team.red>div,.tug-player-team.blue>div{justify-content:center;padding-left:8px;padding-right:8px}.tug-player-team.red .tug-character,.tug-player-team.blue .tug-character{transform:none}.tug-player-team .tug-character{min-width:104px;max-width:122px}.tug-player-team .tug-character .tug-character-stage{min-height:150px}.tug-player-team .tug-character .tug-avatar-art{max-height:146px}}
@media(max-width:620px){.tug-live-avatars{grid-template-columns:1fr}.tug-live-avatars>span:last-child{justify-content:center;padding-right:8px}.tug-live-avatars>span:first-child{justify-content:center;padding-left:8px}.tug-avatar-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.tug-avatar-choice{min-height:236px}.tug-avatar-choice .tug-character.compact .tug-character-stage{min-height:132px}.tug-avatar-choice .tug-character.compact .tug-avatar-art{max-height:128px}.tug-player-rope p{bottom:10px;font-size:.88rem}.tug-player-rope .tug-rope-line{width:calc(100% + 120px);margin-left:-60px;height:18px}}


/* Direction, team color, and hand-rope alignment fixes */
.tug-character{position:relative}
.tug-character.team-red::after,.tug-character.team-blue::after{content:'';position:absolute;left:50%;bottom:14px;transform:translateX(-50%);width:72%;height:38%;border-radius:999px;filter:blur(14px);opacity:.42;z-index:0;pointer-events:none}
.tug-character.team-red::after{background:radial-gradient(ellipse at center,rgba(228,59,77,.45),rgba(228,59,77,0) 72%)}
.tug-character.team-blue::after{background:radial-gradient(ellipse at center,rgba(56,132,255,.45),rgba(56,132,255,0) 72%)}
.tug-character-stage{position:relative;z-index:1}
.tug-avatar-art{position:relative;z-index:2}
.tug-live-avatars .tug-character,.tug-player-team .tug-character{gap:4px}
.tug-live-avatars .tug-character-stage,.tug-player-team .tug-character-stage{order:1}
.tug-live-avatars .tug-character-name,.tug-player-team .tug-character-name{order:2;margin-top:4px}
.tug-live-avatars .tug-character-meta,.tug-player-team .tug-character-meta{order:3}

.tug-teacher-arena .tug-rope-wrap{padding-top:130px;min-height:308px}
.tug-player-rope{min-height:228px;padding-bottom:84px}
.tug-player-rope .tug-rope-wrap{justify-content:flex-start;min-height:228px;padding-top:132px}
.tug-player-rope .tug-rope-line{height:20px}
.tug-live-avatars{bottom:10px}
.tug-live-avatars>span{min-height:150px}
.tug-live-avatars>span .tug-character{min-width:126px;max-width:152px}
.tug-live-avatars>span .tug-character .tug-character-stage{min-height:146px}
.tug-live-avatars>span .tug-character .tug-avatar-art{max-height:142px}
.tug-player-team>div{min-height:222px;padding-bottom:24px}
.tug-player-team .tug-character{min-width:136px;max-width:162px}
.tug-player-team .tug-character .tug-character-stage{min-height:184px}
.tug-player-team .tug-character .tug-avatar-art{max-height:178px}
.tug-player-team.red>div{justify-content:flex-end;padding-right:20px}
.tug-player-team.blue>div{justify-content:flex-start;padding-left:20px}
.tug-player-team.red .tug-character{transform:translate(34px,-14px)}
.tug-player-team.blue .tug-character{transform:translate(-34px,-14px)}
.tug-live-avatars>span:first-child .tug-character{transform:translate(18px,-6px)}
.tug-live-avatars>span:last-child .tug-character{transform:translate(-18px,-6px)}

/* connector rope at hand level */
.tug-live-avatars .tug-character-stage::after,.tug-player-team .tug-character-stage::after{content:'';position:absolute;top:55px;height:12px;border-radius:999px;background:linear-gradient(180deg,rgba(255,255,255,.26),rgba(255,255,255,0) 35%),repeating-linear-gradient(90deg,#d6b178 0 13px,#b57a3c 13px 26px,#dfbc89 26px 39px,#a66b33 39px 52px);box-shadow:inset 0 2px 2px rgba(255,255,255,.18),inset 0 -2px 4px rgba(84,53,24,.26),0 4px 10px rgba(60,38,16,.1);z-index:1}
.tug-live-avatars .team-red .tug-character-stage::after,.tug-player-team.red .team-red .tug-character-stage::after{left:58%;width:96px}
.tug-live-avatars .team-blue .tug-character-stage::after,.tug-player-team.blue .team-blue .tug-character-stage::after{right:58%;width:96px}
.tug-player-team.red .team-red .tug-character-stage::after{left:56%;width:138px}
.tug-player-team.blue .team-blue .tug-character-stage::after{right:56%;width:138px}

/* clearer side reading */
.tug-player-team.red .tug-character-name,.tug-live-avatars .team-red .tug-character-name{color:#ffd7db}
.tug-player-team.blue .tug-character-name,.tug-live-avatars .team-blue .tug-character-name{color:#d4e9ff}
.tug-player-team.red>span,.tug-score-team.red h3{box-shadow:0 10px 24px rgba(161,30,47,.25)}
.tug-player-team.blue>span,.tug-score-team.blue h3{box-shadow:0 10px 24px rgba(34,96,191,.24)}

body.theme-rgb .tug-character.team-red::after{background:radial-gradient(ellipse at center,rgba(247,86,104,.42),rgba(247,86,104,0) 72%)}
body.theme-rgb .tug-character.team-blue::after{background:radial-gradient(ellipse at center,rgba(88,163,255,.4),rgba(88,163,255,0) 72%)}
body.theme-rgb .tug-player-team.red .tug-character-name,body.theme-rgb .tug-live-avatars .team-red .tug-character-name{color:#ffdce0}
body.theme-rgb .tug-player-team.blue .tug-character-name,body.theme-rgb .tug-live-avatars .team-blue .tug-character-name{color:#d8ebff}
body.theme-rgb .tug-live-avatars .tug-character-stage::after,body.theme-rgb .tug-player-team .tug-character-stage::after{background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,0) 35%),repeating-linear-gradient(90deg,#d5b27e 0 13px,#b2773a 13px 26px,#dcb886 26px 39px,#9f6935 39px 52px)}

@media(max-width:1100px){.tug-player-team.red .tug-character{transform:translate(22px,-10px)}.tug-player-team.blue .tug-character{transform:translate(-22px,-10px)}.tug-player-rope .tug-rope-wrap{padding-top:118px}.tug-teacher-arena .tug-rope-wrap{padding-top:118px}.tug-player-team .team-red .tug-character-stage::after{width:112px}.tug-player-team .team-blue .tug-character-stage::after{width:112px}}
@media(max-width:900px){.tug-player-rope{min-height:180px;padding-bottom:54px}.tug-player-rope .tug-rope-wrap{min-height:180px;padding-top:96px}.tug-teacher-arena .tug-rope-wrap{padding-top:90px;min-height:236px}.tug-live-avatars{position:relative;bottom:auto;margin-top:-28px}.tug-live-avatars>span .tug-character,.tug-player-team .tug-character{transform:none;min-width:104px;max-width:126px}.tug-live-avatars>span .tug-character .tug-avatar-art{max-height:124px}.tug-player-team .tug-character .tug-avatar-art{max-height:150px}.tug-live-avatars .tug-character-stage::after,.tug-player-team .tug-character-stage::after{top:50px;width:88px!important}}
@media(max-width:620px){.tug-player-rope .tug-rope-wrap{padding-top:86px}.tug-live-avatars .tug-character-stage::after,.tug-player-team .tug-character-stage::after{top:46px;height:10px;width:72px!important}}


/* Single-rope clean rebuild */
/* remove patchy helper ropes */
.tug-live-avatars .tug-character-stage::after,
.tug-player-team .tug-character-stage::after{display:none!important}

/* teacher live arena */
.tug-teacher-arena{
  position:relative;
  display:block;
  min-height:340px;
  padding:18px 18px 22px;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 10%, rgba(255,255,255,.62), transparent 32%),
    linear-gradient(180deg,#d9edf9 0 62%, #c9dff0 62% 72%, #b4ce8f 72% 100%);
}
.tug-arena-score{
  position:absolute;
  top:86px;
  z-index:4;
  width:128px;
}
.tug-arena-score.red{left:18px}
.tug-arena-score.blue{right:18px}
.tug-rope-wrap{
  position:absolute;
  left:34px;
  right:34px;
  top:146px;
  min-height:0;
  padding:0;
  z-index:1;
}
.tug-rope-wrap .tug-rope-line,
.tug-player-rope .tug-rope-line{
  position:relative;
  height:18px;
  margin:0;
  border-radius:999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 34%),
    repeating-linear-gradient(90deg, #d4af79 0 16px, #b3773c 16px 32px, #dfbc89 32px 48px, #a16833 48px 64px);
  box-shadow:inset 0 2px 2px rgba(255,255,255,.25), inset 0 -3px 4px rgba(88,56,24,.32), 0 8px 18px rgba(74,47,21,.16);
}
.tug-rope-wrap .tug-rope-line::before,
.tug-player-rope .tug-rope-line::before{content:'';position:absolute;left:0;right:0;top:3px;height:4px;border-radius:999px;background:rgba(255,255,255,.16)}
.tug-rope-wrap .tug-rope-line::after,
.tug-player-rope .tug-rope-line::after{content:'';position:absolute;left:8%;right:8%;bottom:-12px;height:8px;border-radius:999px;background:radial-gradient(ellipse at center, rgba(77,54,27,.12), rgba(77,54,27,0) 70%)}
.tug-rope-wrap .tug-rope-knot,
.tug-player-rope .tug-rope-knot{top:50%;transform:translate(-50%,-54%);width:26px;height:56px;font-size:0;z-index:2;filter:drop-shadow(0 5px 6px rgba(78,22,30,.22))}
.tug-rope-wrap .tug-rope-knot::before,
.tug-player-rope .tug-rope-knot::before{content:'';position:absolute;left:50%;top:2px;width:12px;height:18px;background:linear-gradient(180deg,#f76c77,#cb2d3a);border-radius:10px 10px 4px 4px;transform:translateX(-50%)}
.tug-rope-wrap .tug-rope-knot::after,
.tug-player-rope .tug-rope-knot::after{content:'';position:absolute;left:50%;top:18px;width:28px;height:34px;background:linear-gradient(180deg,#f86974,#c92735);clip-path:polygon(50% 0,100% 18%,72% 100%,50% 78%,28% 100%,0 18%);transform:translateX(-50%)}
.tug-rope-wrap .tug-finish,.tug-rope-wrap .tug-center,
.tug-player-rope .tug-finish,.tug-player-rope .tug-center{top:-14px;height:46px;width:4px;border-radius:999px}
.tug-rope-wrap .tug-finish.red,.tug-player-rope .tug-finish.red{left:1.25%;background:linear-gradient(180deg,#ff7d88,#cb2c39)}
.tug-rope-wrap .tug-finish.blue,.tug-player-rope .tug-finish.blue{right:1.25%;background:linear-gradient(180deg,#95c7ff,#2f73da)}
.tug-rope-wrap .tug-center,.tug-player-rope .tug-center{left:50%;transform:translateX(-50%);background:linear-gradient(180deg,#93a7bc,#6d8198);opacity:.52}

.tug-live-avatars{
  position:absolute;
  left:0; right:0;
  top:-78px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  z-index:3;
  pointer-events:none;
}
.tug-live-avatars>span{display:flex;align-items:flex-end;min-height:180px;padding:0 18px}
.tug-live-avatars>span:first-child{justify-content:flex-end;padding-right:110px}
.tug-live-avatars>span:last-child{justify-content:flex-start;padding-left:110px}
.tug-live-avatars .tug-character{min-width:132px;max-width:156px;gap:6px}
.tug-live-avatars .tug-character-stage{min-height:172px}
.tug-live-avatars .tug-avatar-art{max-height:166px}
.tug-live-avatars .tug-character-name{font-size:1rem;color:#17395b;text-shadow:0 1px 0 rgba(255,255,255,.35)}

/* player battle arena */
.tug-world{
  position:relative;
  display:grid;
  grid-template-columns:1fr 1fr;
  column-gap:20px;
  min-height:400px;
  padding:26px 24px 118px;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(255,255,255,.62), transparent 36%),
    linear-gradient(180deg,#d9edf9 0 60%, #c6ddee 60% 70%, #afc88b 70% 100%);
}
.tug-player-rope{
  position:absolute;
  left:34px;
  right:34px;
  top:144px;
  min-height:0;
  padding:0;
  z-index:1;
}
.tug-player-rope p{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:-66px;
  margin:0;
  padding:10px 16px;
  border-radius:999px;
  background:rgba(255,255,255,.86);
  box-shadow:0 8px 18px rgba(16,31,46,.1);
  color:#17395b;
  white-space:nowrap;
}
.tug-player-team{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:10px;
}
.tug-player-team>span{
  align-self:flex-start;
  min-width:150px;
  padding:10px 18px;
  border-radius:999px;
  color:#fff;
  font-weight:900;
  letter-spacing:.08em;
  box-shadow:0 10px 22px rgba(18,24,40,.18);
}
.tug-player-team.blue>span{align-self:flex-end}
.tug-player-team>div{
  position:relative;
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  min-height:240px;
  padding:14px 24px 0;
  gap:14px;
}
.tug-player-team.red>div{justify-content:flex-end;padding-right:88px}
.tug-player-team.blue>div{justify-content:flex-start;padding-left:88px}
.tug-player-team>div::after,
.tug-live-avatars>span::after{content:'';position:absolute;left:18%;right:18%;bottom:6px;height:14px;border-radius:999px;background:radial-gradient(ellipse at center, rgba(69,97,40,.28), rgba(69,97,40,0) 72%)}
.tug-player-team .tug-character{min-width:136px;max-width:164px;gap:6px}
.tug-player-team .tug-character-stage{min-height:176px}
.tug-player-team .tug-avatar-art{max-height:170px}
.tug-player-team .tug-character-name{font-size:1rem;text-shadow:0 1px 0 rgba(255,255,255,.35)}
.tug-player-team.red .tug-character-name{color:#fff0f2}
.tug-player-team.blue .tug-character-name{color:#eef7ff}

/* simplify avatar treatment */
.tug-character::after{display:none!important}
.tug-character-stage.asset-missing{display:grid;place-items:center;min-height:130px;border-radius:18px;background:linear-gradient(180deg,#eaf3fb,#d9e8f5)}
.tug-avatar-fallback{display:inline-flex;align-items:center;justify-content:center;width:72px;height:72px;border-radius:999px;background:linear-gradient(180deg,#eef5ff,#cfe1f7);color:#17395b;font-weight:900;letter-spacing:.08em}
.tug-character.state-idle .tug-avatar-art{animation:tugIdleAsset 2.6s ease-in-out infinite}
.tug-character.state-ready .tug-avatar-art,.tug-character.state-pull .tug-avatar-art,.tug-character.state-hold .tug-avatar-art{animation:tugBraceAsset 1s ease-in-out infinite alternate}
.tug-character.pulse-pull .tug-avatar-art,.tug-character.pulse-power .tug-avatar-art{animation:tugPowerAsset .45s ease-in-out 2}

/* score cards */
.tug-score-team{background:linear-gradient(180deg,#fff,#f4f8fd);border:1px solid #d6e3ef;border-radius:24px;padding:16px;box-shadow:0 14px 28px rgba(17,24,39,.06)}
.tug-score-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 12px;border-radius:18px;background:#fff;border:1px solid #e4edf5}
.tug-score-avatar{width:92px;height:104px;display:flex;align-items:flex-end;justify-content:center;border-radius:16px;background:linear-gradient(180deg,#fbfdff,#eef5fb)}
.tug-score-avatar .tug-character{min-width:86px;max-width:86px}
.tug-score-avatar .tug-character-stage{min-height:96px}
.tug-score-avatar .tug-avatar-art{max-height:92px}

/* RGB theme */
body.theme-rgb .tug-teacher-arena,
body.theme-rgb .tug-world{
  background:
    radial-gradient(circle at 50% 8%, rgba(119,172,236,.14), transparent 36%),
    linear-gradient(180deg,#0f2239 0 60%, #153048 60% 70%, #102d1f 70% 100%)!important;
}
body.theme-rgb .tug-score-team,
body.theme-rgb .tug-score-card{background:linear-gradient(180deg,#132842,#0d1e32);border-color:#294765;box-shadow:none}
body.theme-rgb .tug-score-avatar{background:linear-gradient(180deg,#152d49,#102036)}
body.theme-rgb .tug-player-rope p{background:rgba(16,36,61,.82);color:#eef4ff;box-shadow:0 8px 18px rgba(0,0,0,.2)}
body.theme-rgb .tug-live-avatars .tug-character-name, body.theme-rgb .tug-player-team .tug-character-name{color:#eef4ff}
body.theme-rgb .tug-score-metrics b, body.theme-rgb .tug-chip-info strong{color:#eef4ff}
body.theme-rgb .tug-score-metrics span, body.theme-rgb .tug-chip-info span, body.theme-rgb .tug-character-meta{color:#9db1c8}
body.theme-rgb .tug-live-avatars>span::after, body.theme-rgb .tug-player-team>div::after{background:radial-gradient(ellipse at center, rgba(28,88,61,.42), rgba(28,88,61,0) 72%)}
body.theme-rgb .tug-rope-wrap .tug-rope-line, body.theme-rgb .tug-player-rope .tug-rope-line{background:linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 34%), repeating-linear-gradient(90deg, #d5b27d 0 16px, #b2773a 16px 32px, #dcb886 32px 48px, #9f6935 48px 64px)}
body.theme-rgb .tug-character-stage.asset-missing{background:linear-gradient(180deg,#17304e,#102339)}
body.theme-rgb .tug-avatar-fallback{background:linear-gradient(180deg,#173352,#10243b);color:#eef4ff}

/* responsive */
@media(max-width:1100px){
  .tug-live-avatars>span:first-child{padding-right:78px}.tug-live-avatars>span:last-child{padding-left:78px}
  .tug-player-team.red>div{padding-right:56px}.tug-player-team.blue>div{padding-left:56px}
}
@media(max-width:900px){
  .tug-teacher-arena{min-height:420px;padding:18px 12px 18px}.tug-arena-score{top:14px;width:118px}.tug-arena-score.red{left:12px}.tug-arena-score.blue{right:12px}
  .tug-rope-wrap{left:18px;right:18px;top:172px}.tug-live-avatars{top:-58px}.tug-live-avatars>span{min-height:162px;padding:0 8px}.tug-live-avatars>span:first-child{padding-right:44px}.tug-live-avatars>span:last-child{padding-left:44px}
  .tug-live-avatars .tug-character{min-width:118px;max-width:138px}.tug-live-avatars .tug-avatar-art{max-height:148px}
  .tug-world{grid-template-columns:1fr;row-gap:12px;min-height:520px;padding:18px 14px 126px}.tug-player-team.red{order:1}.tug-player-team.blue{order:2}.tug-player-rope{top:204px;left:18px;right:18px}.tug-player-team>div{min-height:190px;padding:0 10px}.tug-player-team.red>div,.tug-player-team.blue>div{justify-content:center;padding-left:10px;padding-right:10px}.tug-player-team>span{align-self:center}.tug-player-team.blue>span{align-self:center}
}
@media(max-width:620px){
  .tug-avatar-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.tug-avatar-choice{min-height:236px}.tug-avatar-choice .tug-character.compact .tug-character-stage{min-height:132px}.tug-avatar-choice .tug-character.compact .tug-avatar-art{max-height:128px}
  .tug-live-avatars{grid-template-columns:1fr;gap:6px;top:-48px}.tug-live-avatars>span:first-child,.tug-live-avatars>span:last-child{justify-content:center;padding:0 6px}
  .tug-arena-score{top:12px;width:104px}.tug-rope-wrap{top:190px}
  .tug-player-rope{top:214px}.tug-player-rope p{bottom:-60px;font-size:.9rem;padding:8px 12px}.tug-player-team .tug-character{min-width:108px;max-width:132px}.tug-player-team .tug-avatar-art{max-height:150px}
}


/* v6.1 minimal cleanup */
/* Small targeted fixes only: raise rope a bit, enlarge avatars a bit, move player status bubble */
.tug-rope-wrap{top:132px}
.tug-player-rope{top:132px}
.tug-live-avatars{top:-84px}
.tug-live-avatars .tug-character{min-width:138px;max-width:162px}
.tug-live-avatars .tug-character-stage{min-height:178px}
.tug-live-avatars .tug-avatar-art{max-height:172px}
.tug-player-team .tug-character{min-width:142px;max-width:170px}
.tug-player-team .tug-character-stage{min-height:182px}
.tug-player-team .tug-avatar-art{max-height:176px}
.tug-player-rope p{bottom:-92px;max-width:min(82%,620px);text-align:center;white-space:normal;line-height:1.25}

@media(max-width:1100px){
  .tug-live-avatars .tug-character{min-width:128px;max-width:150px}
  .tug-live-avatars .tug-avatar-art{max-height:160px}
  .tug-player-team .tug-character{min-width:132px;max-width:156px}
  .tug-player-team .tug-avatar-art{max-height:164px}
}
@media(max-width:900px){
  .tug-rope-wrap{top:160px}
  .tug-player-rope{top:192px}
  .tug-live-avatars{top:-64px}
  .tug-live-avatars .tug-character{min-width:122px;max-width:142px}
  .tug-live-avatars .tug-avatar-art{max-height:152px}
  .tug-player-team .tug-character{min-width:120px;max-width:144px}
  .tug-player-team .tug-avatar-art{max-height:148px}
  .tug-player-rope p{bottom:-84px;max-width:88%}
}
@media(max-width:620px){
  .tug-rope-wrap{top:176px}
  .tug-player-rope{top:204px}
  .tug-live-avatars{top:-54px}
  .tug-live-avatars .tug-character{min-width:112px;max-width:132px}
  .tug-live-avatars .tug-avatar-art{max-height:136px}
  .tug-player-team .tug-character{min-width:108px;max-width:132px}
  .tug-player-team .tug-avatar-art{max-height:142px}
  .tug-player-rope p{bottom:-78px;font-size:.88rem;padding:8px 12px;max-width:92%}
}


/* Tug difficulty keyboard + Team A/B visual update */
/* Medium uses the same keyboard structure as the Type page, but without answer highlighting. */
#customGameKeyboard.real-keyboard{gap:7px;overflow:hidden;padding:18px}
#customGameKeyboard.real-keyboard .key-row{width:100%;min-width:0;gap:6px;justify-content:center}
#customGameKeyboard.real-keyboard .key{flex:0 1 68px;min-width:45px;max-width:76px}
#customGameKeyboard.real-keyboard .modifier{flex:none;max-width:none;padding:0 11px;font:800 .72rem Inter,sans-serif}
#customGameKeyboard.real-keyboard .modifier small{display:none}
#customGameKeyboard.real-keyboard .backspace-key{width:116px}
#customGameKeyboard.real-keyboard .tab-key{width:88px}
#customGameKeyboard.real-keyboard .caps-key{width:105px}
#customGameKeyboard.real-keyboard .enter-key{width:112px}
#customGameKeyboard.real-keyboard .shift-key{width:138px}
#customGameKeyboard.real-keyboard .keyboard-row-bottom{padding:0 6%}
#customGameKeyboard.real-keyboard .keyboard-row-bottom .system-key{width:86px}
#customGameKeyboard.real-keyboard .keyboard-row-bottom .space{width:auto;max-width:520px;flex:1}
#customGameKeyboard.real-keyboard .keyboard-row-1{padding-left:1.5%}
#customGameKeyboard.real-keyboard .keyboard-row-2{padding-left:2.6%}
#customGameKeyboard.real-keyboard .keyboard-row-3{padding-left:4%}
#customGameKeyboard.real-keyboard .system-key{font-size:.68rem;color:#718096;cursor:default}
#customGameKeyboard.real-keyboard .system-key:active{transform:none;border-bottom-width:3px}

/* Team A / Team B use interface accents instead of avatar clothing colors. */
.tug-team-choice.red.selected{border-color:#d6a43b;background:#fff8e7;color:#805900}
.tug-team-choice.blue.selected{border-color:#42a7ba;background:#eefbfd;color:#126273}
.tug-lobby-team.red{border-color:#ecd49a;background:#fffaf0}
.tug-lobby-team.blue{border-color:#9fd8e2;background:#f2fcfd}
.tug-mini-team.red{background:#fff0c7;color:#755000}
.tug-mini-team.blue{background:#dff6f8;color:#126273}
.tug-arena-score.red span,.tug-arena-score.red strong{color:#c38a18}
.tug-arena-score.blue span,.tug-arena-score.blue strong{color:#258da1}
.tug-player-team.red>span,.tug-lobby-team.red h3,.tug-score-team.red h3{background:linear-gradient(180deg,#efc45f,#c99327);color:#fff}
.tug-player-team.blue>span,.tug-lobby-team.blue h3,.tug-score-team.blue h3{background:linear-gradient(180deg,#63bfd0,#2b91a5);color:#fff}
.team-red-text{color:#c38a18!important}
.team-blue-text{color:#258da1!important}
.tug-finish.red{background:linear-gradient(180deg,#f1cb70,#c99021)!important}
.tug-finish.blue{background:linear-gradient(180deg,#78c8d7,#2c91a4)!important}
.tug-arena-score.red{border-color:rgba(214,164,59,.25)}
.tug-arena-score.blue{border-color:rgba(66,167,186,.25)}

body.theme-rgb .tug-team-choice.red.selected{background:#3b321d;border-color:#d7ad4e;color:#ffe6a8}
body.theme-rgb .tug-team-choice.blue.selected{background:#15363d;border-color:#49b1c4;color:#c9f5fb}
body.theme-rgb .tug-lobby-team.red{background:#2b281b;border-color:#6b592a}
body.theme-rgb .tug-lobby-team.blue{background:#132f36;border-color:#2f6771}
body.theme-rgb .tug-mini-team.red{background:#4b3c16;color:#ffe3a0}
body.theme-rgb .tug-mini-team.blue{background:#183e47;color:#c8f4fa}
body.theme-rgb .team-red-text{color:#f2c761!important}
body.theme-rgb .team-blue-text{color:#69cfdf!important}
body.theme-rgb .tug-arena-score.red span,body.theme-rgb .tug-arena-score.red strong{color:#f2c761}
body.theme-rgb .tug-arena-score.blue span,body.theme-rgb .tug-arena-score.blue strong{color:#69cfdf}
body.theme-rgb #customGameKeyboard.real-keyboard .system-key{color:#9fb0c8}

@media(max-width:720px){
  #customGameKeyboard.real-keyboard{padding:14px 10px;overflow-x:auto}
  #customGameKeyboard.real-keyboard .key-row{justify-content:flex-start;min-width:680px}
  #customGameKeyboard.real-keyboard .key{height:56px}
}

/* Desktop/Chromebook learning hint: both Shift keys glow only when Shift is required. */
.keyboard .key.desktop-shift-hint{border-color:#f0b429!important;background:#fff1b8!important;color:#6b4600!important;box-shadow:0 0 0 3px rgba(240,180,41,.24),0 0 18px rgba(240,180,41,.34)!important}

/* Tug of War's room language is selected by the host (independent of site tabs). */
.tug-host-settings label:last-child{grid-column:auto}
.tug-language-note{margin:0;padding:9px 12px;border:1px solid #cde3f4;border-radius:10px;background:#eaf6ff;color:#275579;font-size:.84rem;line-height:1.45}
.tug-language-badge{display:inline-flex;align-items:center;width:max-content;max-width:100%;margin:4px 0 10px;padding:6px 11px;border:1px solid #9cdbda;border-radius:999px;background:rgba(27,174,168,.11);color:#12635e;font-size:.78rem;font-weight:800;letter-spacing:.01em}
.tug-lobby-copy>.tug-language-badge{margin:0 0 13px}
.tug-teacher-head .tug-language-badge{margin:7px 0 0}
.custom-challenge>.tug-language-badge{display:flex;margin:10px auto 6px}
body.theme-rgb .tug-language-note{border-color:#375a76;background:#122e42;color:#b3e1e9}
body.theme-rgb .tug-language-badge{border-color:#2d8f94;background:rgba(20,174,178,.12);color:#8ee7ec}
@media(max-width:620px){.tug-host-settings label:last-child{grid-column:auto}}

.tug-language-note[hidden],.tug-language-badge[hidden]{display:none!important}
