.trench-warmup-root {
    width: 100%;
    height: 100%;
}

.trench-warmup-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 148px;
    padding: 0.72rem 0.95rem 0.78rem;
    border: 1px solid rgba(167, 139, 250, 0.18);
    border-radius: 8px;
    background:
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(9, 12, 26, 0.98), rgba(6, 9, 18, 0.98));
    color: #e5e7eb;
    user-select: none;
}

.trench-warmup-shell.is-active {
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.16);
}

.trench-warmup-back {
    position: absolute;
    top: 0.7rem;
    left: 0.78rem;
    height: 1.45rem;
    padding: 0 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.84);
    color: #f8fafc;
    font: 700 0.66rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.trench-warmup-modes {
    position: absolute;
    top: 0.72rem;
    left: 50%;
    display: inline-flex;
    gap: 0.22rem;
    padding: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.68);
    transform: translateX(-50%);
}

.trench-warmup-mode-button {
    height: 1.35rem;
    padding: 0 0.7rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(203, 213, 225, 0.72);
    font: 700 0.62rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.trench-warmup-mode-button.is-active {
    background: rgba(139, 92, 246, 0.18);
    color: #f5f3ff;
}

.trench-warmup-timer {
    position: absolute;
    top: 0.72rem;
    right: 0.82rem;
    min-width: 3.2rem;
    padding: 0.26rem 0.58rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #f5f3ff;
    font: 700 0.84rem/1 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    text-align: center;
}

.trench-warmup-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding-top: 2.2rem;
}

.trench-warmup-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}

.trench-warmup-gridshot-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.trench-warmup-gridshot-playfield {
    position: relative;
    flex: 0 0 auto;
    width: 500px;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.trench-warmup-gridshot-unavailable {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    max-width: 18rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(167, 139, 250, 0.18);
    border-radius: 0.9rem;
    background: rgba(15, 23, 42, 0.72);
    text-align: center;
}

.trench-warmup-gridshot-unavailable strong {
    color: #f5f3ff;
    font: 700 0.8rem/1.2 Inter, system-ui, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.trench-warmup-gridshot-unavailable span {
    color: rgba(203, 213, 225, 0.82);
    font: 600 0.76rem/1.45 Inter, system-ui, sans-serif;
}

.trench-warmup-gridshot-target-button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    transform: translate(-50%, -50%);
}

.trench-warmup-gridshot-target-button:hover .trench-warmup-gridshot-target {
    transform: scale(1.06);
}

.trench-warmup-gridshot-target {
    width: 1.28rem;
    height: 1.28rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f5f3ff, #c084fc 44%, #7c3aed 100%);
    box-shadow: 0 0 16px rgba(167, 139, 250, 0.34);
    transition: transform 90ms ease, box-shadow 90ms ease;
}

.trench-warmup-gridshot-target::before {
    content: "";
    position: absolute;
    inset: -0.4rem;
    border: 2px solid rgba(196, 181, 253, 0.28);
    border-radius: 50%;
}

.trench-warmup-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    width: 100%;
}

.trench-warmup-text-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0;
    min-height: 2.2rem;
    max-width: 100%;
    white-space: nowrap;
    font: 700 1.22rem/1.2 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    letter-spacing: 0.01em;
}

.trench-warmup-text-line--active {
    min-height: 1.7rem;
}

.trench-warmup-text-line--next {
    min-height: 1.35rem;
    font-size: 0.98rem;
    opacity: 0.48;
}

.trench-warmup-char {
    position: relative;
    color: rgba(107, 114, 128, 0.95);
    transition: color 70ms linear, background-color 70ms linear;
}

.trench-warmup-char--next-line.is-pending {
    color: rgba(107, 114, 128, 0.72);
}

.trench-warmup-char.is-correct {
    color: #f3f4f6;
}

.trench-warmup-char.is-incorrect {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.35);
    border-radius: 3px;
}

.trench-warmup-char.is-active::after {
    content: "";
    position: absolute;
    left: -1px;
    top: -0.12rem;
    width: 2px;
    height: 1.22rem;
    background: #a78bfa;
    border-radius: 999px;
    animation: trenchWarmupCaret 1s steps(1) infinite;
}

.trench-warmup-char--end {
    display: inline-block;
    width: 0.25rem;
}

.trench-warmup-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.trench-warmup-results-kicker {
    color: rgba(196, 181, 253, 0.9);
    font: 700 0.62rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.trench-warmup-results-grid {
    display: grid;
    gap: 0.45rem;
}

.trench-warmup-results-grid--typing {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trench-warmup-results-grid--gridshot {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.trench-warmup-results-grid div {
    min-width: 4.3rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.74);
    text-align: center;
}

.trench-warmup-results-grid span {
    display: block;
    margin-bottom: 0.18rem;
    color: rgba(156, 163, 175, 0.84);
    font: 700 0.55rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.trench-warmup-results-grid strong {
    color: #f5f3ff;
    font: 700 0.92rem/1 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.trench-warmup-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
    max-width: 22rem;
}

.trench-warmup-leaderboard-label {
    color: rgba(196, 181, 253, 0.88);
    font: 700 0.54rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
}

.trench-warmup-leaderboard-list {
    display: flex;
    gap: 0.22rem;
}

.trench-warmup-leaderboard-item {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.22rem 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.45rem;
    background: rgba(15, 23, 42, 0.6);
    color: rgba(226, 232, 240, 0.86);
    font: 600 0.62rem/1.2 Inter, system-ui, sans-serif;
}

.trench-warmup-leaderboard-item strong {
    color: #f5f3ff;
    font: 700 0.66rem/1 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.trench-warmup-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.trench-warmup-home-title {
    color: #f5f3ff;
    font: 700 1rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.02em;
}

.trench-warmup-home-bests {
    display: flex;
    gap: 0.7rem;
    color: rgba(196, 181, 253, 0.7);
    font: 600 0.62rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.04em;
}

.trench-warmup-home-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.trench-warmup-home-play {
    height: 1.7rem;
    padding: 0 1.2rem;
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 999px;
    background: rgba(91, 33, 182, 0.2);
    color: #f5f3ff;
    font: 700 0.7rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.trench-warmup-home-lb-btn {
    height: 1.45rem;
    padding: 0 0.8rem;
    border: 1px solid rgba(167, 139, 250, 0.18);
    border-radius: 999px;
    background: rgba(91, 33, 182, 0.1);
    color: rgba(196, 181, 253, 0.85);
    font: 600 0.58rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.trench-warmup-lb-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.trench-warmup-lb-screen-title {
    color: rgba(196, 181, 253, 0.9);
    font: 700 0.62rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.trench-warmup-lb-cols {
    display: flex;
    gap: 0.8rem;
    width: 100%;
    max-width: 28rem;
    justify-content: center;
}

.trench-warmup-lb-cols .trench-warmup-leaderboard {
    flex: 1;
    max-width: 13rem;
}

.trench-warmup-lb-cols .trench-warmup-leaderboard-list {
    flex-direction: column;
}

.trench-warmup-lb-empty {
    color: rgba(196, 181, 253, 0.45);
    font: 600 0.58rem/1.4 Inter, system-ui, sans-serif;
    text-align: center;
    padding: 0.3rem 0;
}

.trench-warmup-restart {
    height: 1.65rem;
    padding: 0 0.86rem;
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 999px;
    background: rgba(91, 33, 182, 0.2);
    color: #f5f3ff;
    font: 700 0.66rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

#gamesDock.games-active .trench-warmup-shell {
    height: 100%;
    border: 0;
    border-radius: 0;
    padding-top: 0.62rem;
}

@keyframes trenchWarmupCaret {
    0%, 50% {
        opacity: 1;
    }
    50.01%, 100% {
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .trench-warmup-shell {
        height: 120px;
        padding: 0.62rem 0.72rem 0.68rem;
    }

    .trench-warmup-timer {
        top: 0.64rem;
        right: 0.68rem;
        min-width: 2.9rem;
        padding: 0.2rem 0.48rem;
        font-size: 0.76rem;
    }

    .trench-warmup-modes {
        top: 0.64rem;
    }

    .trench-warmup-mode-button {
        height: 1.24rem;
        padding: 0 0.56rem;
        font-size: 0.58rem;
    }

    .trench-warmup-text-line {
        font-size: 1.04rem;
    }

    .trench-warmup-text-line--next {
        font-size: 0.86rem;
    }

    .trench-warmup-main {
        padding-top: 2rem;
    }

    .trench-warmup-gridshot-target-button {
        width: 1.95rem;
        height: 1.95rem;
    }

    .trench-warmup-gridshot-target {
        width: 1.06rem;
        height: 1.06rem;
    }

    .trench-warmup-results-grid {
        gap: 0.32rem;
    }

    .trench-warmup-results-grid div {
        min-width: 3.2rem;
        padding: 0.34rem 0.4rem;
    }
}
