/* XType — styles that complement Tailwind (the typing stage + small niceties). */

html { -webkit-text-size-adjust: 100%; }

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection { background: #c7d2fe; }

/* ---- Typing stage (built by js/typing.js) ---- */

#xtype-stage {
    position: relative;
    min-height: 16rem;
    padding: 0.5rem 0;
}

.xt-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2.75rem;
}

.xt-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.xt-stat > span {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.xt-stat > small {
    margin-top: 0.35rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #94a3b8;
}

.xt-time > span { color: #4f46e5; }

.xt-words {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1.25rem;
    min-height: 5rem;
    flex-wrap: nowrap;
    font-family: "JetBrains Mono", ui-monospace, monospace;
}

.xt-prev,
.xt-next {
    font-size: 1.15rem;
    color: #cbd5e1;
    white-space: nowrap;
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}

.xt-cur {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex: 0 0 auto;
}

@media (min-width: 640px) {
    .xt-cur { font-size: 3.25rem; }
    .xt-prev, .xt-next { font-size: 1.5rem; max-width: 22vw; }
    .xt-stat > span { font-size: 2.25rem; }
}

.xt-ok { color: #0f172a; }
.xt-pending { color: #cbd5e1; }
.xt-bad { color: #ef4444; }
.xt-bad.xt-extra {
    color: #f87171;
    text-decoration: underline;
    text-decoration-color: #fca5a5;
}

.xt-caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    transform: translateY(0.12em);
    margin: 0 1px;
    border-radius: 2px;
    background: #4f46e5;
    animation: xt-blink 1.05s steps(1) infinite;
}

@keyframes xt-blink { 50% { opacity: 0; } }

.xt-hint {
    margin-top: 2.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    transition: opacity 0.3s ease;
}

/* The transparent input sits over the stage so a tap anywhere (mobile) opens
   the keyboard. 16px font-size prevents iOS from zooming on focus. */
.xt-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    cursor: text;
    font-size: 16px;
}

.xt-done { opacity: 0.45; transition: opacity 0.3s ease; }

kbd { font-family: "JetBrains Mono", ui-monospace, monospace; }
