/* ==========================================================================
   Tug of War - Math Game
   ========================================================================== */

.tow-container {
    width: 100%;
    min-height: 70vh;
    height: 100%;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #e8f8f5 0%, #d1f2eb 50%, #a3e4d7 100%);
    position: relative;
    overflow: hidden;
}

.tow-hidden { display: none !important; }

/* Ensure container fills parent in fullscreen */
.tool-content-area {
    display: flex;
    flex-direction: column;
}

.tool-page-wrapper:fullscreen .tool-content-area,
.tool-page-wrapper:-webkit-full-screen .tool-content-area,
.tool-page-wrapper.ios-fullscreen .tool-content-area {
    flex: 1 1 0%;
    height: 100%;
}

/* ==========================================================================
   SETUP SCREEN
   ========================================================================== */

.tow-setup {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.tow-setup-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.tow-setup-logo {
    width: 80px;
    margin-bottom: 0.75rem;
}

.tow-setup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.25rem;
}

.tow-setup-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1.5rem;
}

.tow-step-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 1rem;
}

/* Mode Cards */
.tow-mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.tow-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    border-radius: 1rem;
    border: 2px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tow-mode-card i {
    font-size: 2rem;
}

.tow-mode-robot i { color: #0096FF; }
.tow-mode-player i { color: #FF8C00; }

.tow-mode-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tow-mode-robot:hover { border-color: #0096FF; }
.tow-mode-player:hover { border-color: #FF8C00; }

.tow-mode-label {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.tow-mode-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Operation Checkboxes */
.tow-ops-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.tow-op-check {
    cursor: pointer;
}

.tow-op-check input {
    display: none;
}

.tow-op-box {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
    background: #fff;
    transition: all 0.2s ease;
}

.tow-op-check input:checked + .tow-op-box {
    border-color: #15aebf;
    background: #f0fdfa;
    box-shadow: 0 2px 8px rgba(21, 174, 191, 0.15);
}

.tow-op-icon {
    font-size: 1.25rem;
    font-weight: 700;
    color: #15aebf;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f0fdfa;
    flex-shrink: 0;
}

.tow-op-check input:checked + .tow-op-box .tow-op-icon {
    background: #15aebf;
    color: #fff;
}

.tow-op-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.tow-ops-hint {
    font-size: 0.8rem;
    color: #ef4444;
    text-align: center;
    margin: 0 0 0.75rem;
}

/* Make counting span full width (odd item) */
.tow-ops-grid .tow-op-check:first-child {
    grid-column: 1 / -1;
}

/* Team Name Fields */
.tow-name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.tow-name-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.125rem 0.125rem 0.125rem 0.75rem;
    transition: border-color 0.2s;
}

.tow-name-field:focus-within {
    border-color: #15aebf;
}

.tow-team-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tow-dot-blue { background: #0096FF; }
.tow-dot-red { background: #FF8C00; }

.tow-input {
    flex: 1;
    padding: 0.5rem 0.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    background: transparent;
}

/* Game Options */
.tow-options-section {
    margin-bottom: 1.25rem;
}

.tow-option-row {
    display: flex;
    justify-content: center;
}

.tow-turn-check .tow-op-box {
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.tow-turn-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-top: 0.625rem;
}

/* Number Limit & Turn Options */
.tow-limit-section {
    margin-bottom: 1rem;
}

.tow-limit-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
}

.tow-limit-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.tow-limit-input {
    width: 60px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

/* Setup Actions */
.tow-setup-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.tow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.tow-btn-back {
    background: #f1f5f9;
    color: #475569;
}

.tow-btn-back:hover {
    background: #e2e8f0;
}

.tow-btn-start {
    background: linear-gradient(135deg, #15aebf 0%, #4ecdc4 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(21, 174, 191, 0.3);
}

.tow-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 174, 191, 0.4);
}

/* ==========================================================================
   GAME SCREEN
   ========================================================================== */

.tow-game {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

/* Score Bar */
.tow-score-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tow-score-team {
    flex-shrink: 0;
}

.tow-team-name {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tow-score-blue .tow-team-name {
    color: #0096FF;
    background: linear-gradient(135deg, #E0F0FF, #F0F8FF);
    padding: 0.2rem 0.6rem;
    border-radius: 0.5rem;
}

.tow-score-red .tow-team-name {
    color: #FF8C00;
    background: linear-gradient(135deg, #FFF2E0, #FFF8F0);
    padding: 0.2rem 0.6rem;
    border-radius: 0.5rem;
}

.tow-score-meter {
    flex: 1;
}

.tow-meter-track {
    height: 12px;
    background: linear-gradient(90deg, #E0F0FF 0%, #e2e8f0 50%, #FFF2E0 100%);
    border-radius: 6px;
    position: relative;
    overflow: visible;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tow-meter-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, #0096FF, #33ABFF);
    border-radius: 6px 0 0 6px;
    transition: width 0.4s ease;
}

.tow-meter-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #fff, #fef3c7);
    border: 3px solid #f59e0b;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
    transition: left 0.4s ease;
    z-index: 2;
}

/* Turn Bar */
.tow-turn-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    animation: tow-fade-in 0.3s ease;
}

.tow-turn-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tow-turn-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.tow-turn-counter {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
}

.tow-turn-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    margin-inline-start: auto;
}

.tow-turn-timer i {
    font-size: 0.8rem;
}

.tow-turn-timer.tow-timer-danger {
    color: #dc2626;
    background: #fef2f2;
    animation: tow-pulse 0.5s ease infinite;
}

@keyframes tow-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.tow-turn-bar.tow-turn-blue {
    background: linear-gradient(135deg, #E0F0FF, #B3DFFF);
}

.tow-turn-bar.tow-turn-red {
    background: linear-gradient(135deg, #FFF2E0, #FFE0B3);
}

/* Arena */
.tow-arena {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    height: 280px;
    overflow: hidden;
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Grass-like ground */
    background:
        linear-gradient(180deg, #e0f7f1 0%, #c8eddb 50%, #86c67c 60%, #6db362 100%);
}

.tow-arena::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 180px;
    height: 180px;
    background: url('/static/images/zhween-logo-colored.svg') no-repeat center / contain;
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
}

.tow-center-line {
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 50%;
    width: 6px;
    background: rgba(245, 158, 11, 0.6);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    transform: translateX(-50%);
}

/* Scene - slides left/right based on score */
.tow-scene {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    gap: 0;
    transition: transform 0.4s ease;
    position: relative;
}

/* Team Groups */
.tow-team-group {
    display: flex;
    align-items: flex-end;
    min-width: 0;
    position: relative;
    z-index: 3;
}

.tow-team-left {
    justify-content: flex-end;
}

.tow-team-right {
    justify-content: flex-start;
}

.tow-char {
    height: 100px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.tow-char-team {
    height: 200px;
    margin-bottom: 10px;
}

/* Team 1 (blue) faces right towards rope - no flip needed */
.tow-team-left .tow-char-team {
    transform: none;
}

/* Team 2 (orange) flip to face left towards rope */
.tow-team-right .tow-char-team {
    transform: scaleX(-1);
}

/* Pulling animation */
.tow-team-group.tow-pulling .tow-char {
    animation: tow-pull 0.3s ease-in-out;
}

@keyframes tow-pull {
    0% { transform: scaleX(var(--char-dir, 1)) translateX(0); }
    50% { transform: scaleX(var(--char-dir, 1)) translateX(calc(var(--pull-dir, -1) * 8px)); }
    100% { transform: scaleX(var(--char-dir, 1)) translateX(0); }
}

.tow-team-left .tow-char { --char-dir: 1; --pull-dir: -1; }
.tow-team-right .tow-char { --char-dir: -1; --pull-dir: 1; }

/* Rope between teams - extends behind both teams */
.tow-rope {
    width: 900px;
    flex: 0 0 900px;
    position: relative;
    display: flex;
    align-items: center;
    align-self: flex-end;
    margin-bottom: 72px;
    margin-inline-start: -250px;
    margin-inline-end: -250px;
    z-index: 2;
}

.tow-rope-line {
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(
        90deg,
        #a0845c 0px,
        #c4a46c 4px,
        #8b6f47 8px
    );
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tow-rope-flag {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    font-size: 2rem;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
    z-index: 4;
    line-height: 1;
}

/* ==========================================================================
   TEAM PANELS
   ========================================================================== */

.tow-panels {
    display: flex;
    justify-content: center;
    gap: 18rem;
    margin-top: 1.5rem;
}

.tow-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    overflow: hidden;
    width: 560px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: opacity 0.3s, filter 0.3s;
}

.tow-panel.tow-panel-disabled {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(0.4);
}

/* Turn-based: single panel centered & bigger */
.tow-panels-turn {
    gap: 0;
}

.tow-panels-turn .tow-panel {
    width: 560px;
}

.tow-panel-header {
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}

.tow-header-blue {
    background: #0096FF;
    border-bottom: 3px solid #0078CC;
}

.tow-header-red {
    background: #FF8C00;
    border-bottom: 3px solid #CC7000;
}

/* Problem Display */
.tow-problem {
    padding: 0.625rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tow-problem-blue,
.tow-problem-red {
    background: #f1f5f9;
    color: #1e293b;
}

/* Answer Display */
.tow-answer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    margin: 0.4rem 0.6rem;
    padding: 0.3rem 0.6rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: inherit;
    color: #1e293b;
}

.tow-cursor {
    display: inline-block;
    width: 2px;
    height: 1.25em;
    background: #0096FF;
    margin-inline-start: 2px;
    animation: tow-blink 1s infinite;
}

@keyframes tow-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Feedback flash */
.tow-answer-display.tow-correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.tow-answer-display.tow-wrong {
    border-color: #ef4444;
    background: #fef2f2;
    animation: tow-shake 0.3s ease;
}

@keyframes tow-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Numpad */
.tow-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
    padding: 0.5rem 0.75rem 0.75rem;
}

.tow-key {
    padding: 0.6rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: none;
    border-radius: 0.5rem;
    background: #f1f5f9;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
    box-shadow: 0 2px 0 #cbd5e1;
    touch-action: manipulation;
    user-select: none;
}

.tow-key:active {
    transform: translateY(2px);
    box-shadow: none;
}

.tow-panel-blue .tow-key:hover { background: #F0F8FF; }
.tow-panel-red .tow-key:hover { background: #FFF8F0; }

.tow-key-clear {
    background: #fef2f2;
    color: #dc2626;
    box-shadow: 0 2px 0 #fca5a5;
}

.tow-key-ok {
    background: #15aebf;
    color: #fff;
    box-shadow: 0 2px 0 #0e8a96;
}

.tow-key-ok:hover {
    background: #0e9bb2;
}

/* ==========================================================================
   WIN OVERLAY
   ========================================================================== */

.tow-win-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: tow-fade-in 0.4s ease;
}

@keyframes tow-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tow-win-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    animation: tow-pop-in 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes tow-pop-in {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tow-win-trophy {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.tow-win-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    text-align: center;
    width: 100%;
}

.tow-win-text.tow-win-blue { color: #0096FF; }
.tow-win-text.tow-win-red { color: #FF8C00; }

.tow-win-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tow-btn-replay {
    background: linear-gradient(135deg, #15aebf, #4ecdc4);
    color: #fff;
    box-shadow: 0 4px 14px rgba(21, 174, 191, 0.3);
}

.tow-btn-replay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 174, 191, 0.4);
}

.tow-btn-restart {
    background: #f1f5f9;
    color: #475569;
}

.tow-btn-restart:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .tow-setup-card {
        padding: 1.5rem 1.25rem;
    }

    .tow-setup-title {
        font-size: 1.35rem;
    }

    .tow-char {
        height: 70px;
    }

    .tow-char-team {
        height: 140px;
    }

    .tow-rope {
        width: 650px;
        flex: 0 0 650px;
        margin-bottom: 50px;
        margin-inline-start: -180px;
        margin-inline-end: -180px;
    }

    .tow-problem {
        font-size: 1.25rem;
        min-height: 48px;
        padding: 0.5rem;
    }

    .tow-answer-display {
        min-height: 36px;
        font-size: 1.1rem;
        margin: 0.375rem 0.5rem;
    }

    .tow-numpad {
        gap: 0.25rem;
        padding: 0.375rem 0.5rem 0.5rem;
    }

    .tow-key {
        padding: 0.4rem;
        font-size: 1rem;
    }

    .tow-panels {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .tow-panel {
        width: 180px;
    }
}

@media (max-width: 480px) {
    .tow-mode-cards {
        grid-template-columns: 1fr;
    }

    .tow-name-fields {
        grid-template-columns: 1fr;
    }

    .tow-turn-options {
        grid-template-columns: 1fr;
    }

    .tow-ops-grid {
        gap: 0.5rem;
    }

    .tow-char {
        height: 55px;
    }

    .tow-char-team {
        height: 100px;
    }

    .tow-rope {
        width: 480px;
        flex: 0 0 480px;
        margin-bottom: 35px;
        margin-inline-start: -140px;
        margin-inline-end: -140px;
    }

    .tow-arena {
        min-height: 130px;
    }

    .tow-problem {
        font-size: 1.1rem;
        min-height: 42px;
    }

    .tow-key {
        padding: 0.3rem;
        font-size: 0.9rem;
    }

    .tow-panel-header {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }

    .tow-score-bar {
        padding: 0.375rem 0.5rem;
        gap: 0.5rem;
    }

    .tow-team-name {
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   RTL SUPPORT
   ========================================================================== */

/* Force center alignment in RTL */
[dir="rtl"] .tow-container {
    text-align: center;
}

[dir="rtl"] .tow-setup-card,
[dir="rtl"] .tow-panel,
[dir="rtl"] .tow-score-bar,
[dir="rtl"] .tow-turn-bar,
[dir="rtl"] .tow-win-card {
    text-align: center;
}

[dir="rtl"] .tow-problem,
[dir="rtl"] .tow-answer-display,
[dir="rtl"] .tow-panel-header,
[dir="rtl"] .tow-step-heading,
[dir="rtl"] .tow-setup-title,
[dir="rtl"] .tow-setup-subtitle,
[dir="rtl"] .tow-op-name,
[dir="rtl"] .tow-mode-label,
[dir="rtl"] .tow-mode-desc,
[dir="rtl"] .tow-limit-label,
[dir="rtl"] .tow-ops-hint {
    text-align: center;
}

[dir="rtl"] .tow-mode-cards,
[dir="rtl"] .tow-ops-grid,
[dir="rtl"] .tow-setup-actions,
[dir="rtl"] .tow-win-actions {
    justify-content: center;
}

/* Flip directional arrows in RTL */
[dir="rtl"] .tow-btn-back i.bi-arrow-left,
[dir="rtl"] .tow-btn-start i.bi-arrow-right,
[dir="rtl"] .tow-btn-start i.bi-play-fill {
    transform: scaleX(-1);
}

/* Reverse button icon order in RTL */
[dir="rtl"] .tow-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .tow-team-left .tow-char-team {
    transform: scaleX(-1);
}

[dir="rtl"] .tow-team-right .tow-char-team {
    transform: none;
}

[dir="rtl"] .tow-team-left .tow-char { --char-dir: -1; --pull-dir: 1; }
[dir="rtl"] .tow-team-right .tow-char { --char-dir: 1; --pull-dir: -1; }

[dir="rtl"] .tow-meter-track {
    background: linear-gradient(90deg, #FFF2E0 0%, #e2e8f0 50%, #E0F0FF 100%);
}

[dir="rtl"] .tow-meter-fill {
    left: auto;
    right: 0;
    background: linear-gradient(90deg, #33ABFF, #0096FF);
    border-radius: 0 6px 6px 0;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .tow-scene,
    .tow-meter-fill,
    .tow-meter-marker,
    .tow-panel {
        transition: none;
    }

    .tow-cursor {
        animation: none;
        opacity: 1;
    }

    .tow-team-group.tow-pulling .tow-char {
        animation: none;
    }
}
