/* TestHub — тест скорости реакции. Крупная игровая область для мыши и тапа. */
.reaction-app {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.reaction-start {
    padding: clamp(18px, 3vw, 28px);
    text-align: center;
}

.reaction-start__icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 20px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 1.1rem;
    font-weight: 800;
}

.reaction-start h2 {
    margin-bottom: .35em;
}

.reaction-start p {
    max-width: 56ch;
    margin-left: auto;
    margin-right: auto;
    color: var(--muted);
}

.reaction-start .btn {
    margin-top: 10px;
}

.reaction-shell[hidden] {
    display: none;
}

.reaction-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px clamp(16px, 3vw, 26px);
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.reaction-progress {
    flex: 1;
    max-width: 340px;
    height: 8px;
    border-radius: 999px;
    background: #e7e5e4;
    overflow: hidden;
}

.reaction-progress > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #f97316;
    transition: width .25s ease;
}

.reaction-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: clamp(320px, 52vh, 460px);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color .12s linear;
}

.reaction-stage:focus {
    outline: none;
}

.reaction-stage:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: -6px;
}

.reaction-stage[data-state="waiting"] {
    background: linear-gradient(160deg, #b91c1c, #7f1d1d);
    color: #fff;
}

.reaction-stage[data-state="green"],
.reaction-stage[data-state="armed"] {
    background: linear-gradient(160deg, #16a34a, #15803d);
    color: #fff;
}

.reaction-stage[data-state="false"] {
    background: linear-gradient(160deg, #f59e0b, #b45309);
    color: #fff;
}

.reaction-stage[data-state="result"] {
    background: linear-gradient(160deg, #0f172a, #1e293b);
    color: #fff;
}

.reaction-status {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.9rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.reaction-sub {
    margin: 0;
    max-width: 46ch;
    font-size: .95rem;
    opacity: .85;
}

.reaction-result {
    font-size: clamp(2.6rem, 9vw, 4.4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
}

.reaction-result small {
    display: block;
    margin-top: 8px;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: 0;
    opacity: .8;
}

.reaction-history {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.reaction-history li {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: .8rem;
    font-weight: 700;
}

.reaction-foot {
    display: flex;
    justify-content: center;
    padding: 16px clamp(16px, 3vw, 26px);
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
}

.reaction-foot .btn[hidden] {
    display: none;
}

.reaction-error {
    margin: 0;
    padding: 16px clamp(16px, 3vw, 26px);
    color: #b91c1c;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
}

.reaction-hint {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
}

@media (max-width: 520px) {
    .reaction-stage {
        min-height: 340px;
        padding: 22px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reaction-progress > span {
        transition: none;
    }
}
