/*
 * TypeRush — yazma hızı testi.
 *
 * Renkler devtoolbox.css değişkenlerinden (açık/koyu tema oradan).
 * Satır içi stil yok (içerik politikası); betik yalnızca CSSOM ile
 * metni kaydırıyor (transform). Görünüm tercihleri kökteki sınıflar:
 * ty--boyut-*, ty--imlec-*, ty--canli-kapali.
 */

.ty {
    --ty-yazi: 1.45rem;
    --ty-satir: 1.7em;
    --ty-dogru: var(--text);
    --ty-bekleyen: color-mix(in srgb, var(--muted) 70%, transparent);
    --ty-yanlis: var(--bad);
    --ty-yanlis-zemin: color-mix(in srgb, var(--bad) 18%, transparent);
    margin: 0 0 40px;
}

.ty--boyut-kucuk { --ty-yazi: 1.15rem; }
.ty--boyut-buyuk { --ty-yazi: 1.85rem; }

/* ------------------------------------------------------------ seçenekler */

.ty-secenekler {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.ty-grup {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.ty-grup[hidden] { display: none; }

.ty-grup__etiket {
    margin-right: 4px;
    font-size: .8rem;
    color: var(--muted);
}

.ty-secim {
    min-height: 32px;
    padding: 4px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .88rem;
    cursor: pointer;
}

.ty-secim:hover { color: var(--text); border-color: var(--line); }
.ty-secim:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.ty-secim[aria-pressed="true"] {
    color: var(--brand-2);
    border-color: color-mix(in srgb, var(--brand) 50%, transparent);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    font-weight: 600;
}

.ty-ipucu {
    margin: 0;
    font-size: .82rem;
    color: var(--muted);
}

.ty-meydan {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--warn) 60%, transparent);
    background: color-mix(in srgb, var(--warn) 12%, transparent);
    font-weight: 600;
}

/* ------------------------------------------------------------- tercihler */

.ty-tercihler {
    margin-bottom: 12px;
    font-size: .88rem;
}

.ty-tercihler > summary {
    width: fit-content;
    cursor: pointer;
    color: var(--muted);
}

.ty-tercihler > summary:hover { color: var(--text); }

.ty-tercihler__ic {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 10px;
}

.ty-tercih {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: .82rem;
    color: var(--muted);
}

.ty-tercih--genis { display: flex; max-width: 360px; }

.ty-secici,
.ty-kutu {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: .92rem;
}

.ty-secici:focus-visible,
.ty-kutu:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* -------------------------------------------------------------- gösterge */

.ty-gosterge {
    display: flex;
    gap: 26px;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.ty-gosterge__oge { display: flex; align-items: baseline; gap: 6px; }

.ty-gosterge__deger {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand-2);
}

.ty-gosterge__ad { font-size: .8rem; color: var(--muted); }

/* Canlı gösterge kapalı: yazarken yalnızca kalan süre/ilerleme. */
.ty--canli-kapali .ty-gosterge__oge:not(:last-child) { visibility: hidden; }

/* ------------------------------------------------------------ yazma alanı */

.ty-alan {
    position: relative;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    cursor: text;
}

.ty-alan.is-odakta { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }

.ty-metin {
    position: relative;
    height: calc(var(--ty-satir) * 3);
    overflow: hidden;
    font-family: var(--mono);
    font-size: var(--ty-yazi);
    line-height: var(--ty-satir);
}

.ty-metin--kod {
    height: calc(var(--ty-satir) * 8);
    font-size: calc(var(--ty-yazi) * .72);
}

.ty-metin__ic {
    position: relative;
    line-height: var(--ty-satir);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    transition: transform .12s ease-out;
}

.ty-k {
    position: relative;
    color: var(--ty-bekleyen);
}

.ty-k.is-dogru { color: var(--ty-dogru); }
.ty-k.is-oto { color: color-mix(in srgb, var(--muted) 60%, transparent); }

.ty-k.is-yanlis {
    color: var(--ty-yanlis);
    background: var(--ty-yanlis-zemin);
    border-radius: 2px;
}

.ty-k--satir { color: color-mix(in srgb, var(--muted) 45%, transparent); }

/* Yanlış yazılan boşluk görünsün. */
.ty-k.is-yanlis:empty,
.ty-k--son { display: inline-block; min-width: .1em; }

/* İmleç: çizgi (varsayılan), blok, alt çizgi. Odak yokken söner. */
.ty-k.is-imlec::before {
    content: "";
    position: absolute;
    left: -1px;
    top: .15em;
    bottom: .15em;
    width: 2px;
    border-radius: 1px;
    background: var(--brand-2);
    animation: ty-yanip 1s step-end infinite;
}

.ty--imlec-blok .ty-k.is-imlec::before {
    left: 0;
    width: auto;
    right: 0;
    min-width: .55em;
    opacity: .35;
}

.ty--imlec-alt .ty-k.is-imlec::before {
    left: 0;
    right: 0;
    width: auto;
    min-width: .55em;
    top: auto;
    bottom: .05em;
    height: 3px;
}

.ty-alan:not(.is-odakta) .ty-k.is-imlec::before { animation: none; opacity: .25; }

@keyframes ty-yanip {
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ty-k.is-imlec::before { animation: none; }
    .ty-metin__ic { transition: none; }
}

/* Klavye girişini alan gizli kutu: görünmez ama odaklanabilir.
   16px altı yazı iOS'ta sayfayı büyütüyor. */
.ty-girdi {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    resize: none;
    font-size: 16px;
    caret-color: transparent;
}

.ty-odak {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--bg-2) 70%, transparent);
    backdrop-filter: blur(3px);
    color: var(--text);
    font-weight: 600;
}

.ty-odak[hidden] { display: none; }

.ty-alt {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.ty-dugmeler {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ----------------------------------------------------------------- sonuç */

.ty-sonuc {
    margin-top: 26px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    scroll-margin-top: 80px;
}

.ty-sonuc[hidden] { display: none; }

.ty-sonuc__baslik { margin: 0 0 12px; font-size: 1.15rem; }

.ty-sonuc__rekor {
    margin: 0 0 10px;
    color: var(--ok);
    font-weight: 700;
}

.ty-sonuc__rozet {
    margin: 0 0 10px;
    color: var(--warn);
    font-weight: 600;
}

.ty-sonuc__not { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }

.ty-sonuc__ana {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin: 6px 0 12px;
}

.ty-sonuc__kutu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    font-variant-numeric: tabular-nums;
}

.ty-sonuc__deger { font-size: 1.3rem; font-weight: 700; }
.ty-sonuc__ad { font-size: .78rem; color: var(--muted); }
.ty-sonuc__kutu--buyuk .ty-sonuc__deger { font-size: 2rem; color: var(--brand-2); }

.ty-sonuc__karakter { margin: 0 0 14px; font-size: .9rem; color: var(--muted); }
.ty-sonuc__hatalar { margin: 14px 0; }
.ty-sonuc__bildirim { font-size: .85rem; color: var(--ok); }

.ty-alt-baslik { margin: 0 0 8px; font-size: .95rem; }

.ty-not { margin: 12px 0 0; font-size: .82rem; color: var(--muted); }

/* ---------------------------------------------------------------- grafik */

.ty-grafik { margin: 0 0 12px; }

.ty-grafik__svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 260px;
}

.ty-grafik__izgara { stroke: var(--line); stroke-width: 1; }

.ty-grafik__etiket {
    fill: var(--muted);
    font-size: 11px;
    font-family: inherit;
}

.ty-grafik__cizgi { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ty-grafik__nokta { stroke: none; }
.ty-grafik__hata { fill: var(--bad); opacity: .8; }

.ty-grafik__cizgi.ty-seri--net { stroke: var(--brand-2); }
.ty-grafik__cizgi.ty-seri--brut { stroke: var(--muted); stroke-dasharray: 4 3; }
.ty-grafik__nokta.ty-seri--net { fill: var(--brand-2); }
.ty-grafik__nokta.ty-seri--brut { fill: var(--muted); }

.ty-grafik__lejant {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    font-size: .8rem;
    color: var(--muted);
}

.ty-grafik__lejant li { display: inline-flex; align-items: center; gap: 6px; }

.ty-grafik__ornek {
    display: inline-block;
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: var(--muted);
}

.ty-grafik__ornek.ty-seri--net { background: var(--brand-2); }

/* ------------------------------------------------- zayıf tuşlar, rozetler */

.ty-zayif {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.ty-zayif__oge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg);
    font-size: .85rem;
    color: var(--muted);
}

.ty-kbd {
    min-width: 1.8em;
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--bg-3);
    color: var(--text);
    font-family: var(--mono);
    font-size: .95rem;
    text-align: center;
}

.ty-rozetler {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ty-rozet {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    opacity: .6;
}

.ty-rozet.is-kazanildi {
    border-style: solid;
    border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
    background: color-mix(in srgb, var(--warn) 8%, transparent);
    opacity: 1;
}

.ty-rozet__ad { font-weight: 700; }
.ty-rozet__aciklama { font-size: .82rem; color: var(--muted); }
.ty-rozet__durum { font-size: .75rem; color: var(--muted); }
.ty-rozet.is-kazanildi .ty-rozet__durum { color: var(--warn); }

/* ---------------------------------------------------------- ısı haritası */

.ty-klavye {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 12px 0;
    font-family: var(--mono);
}

.ty-klavye__sira { display: flex; gap: 5px; }
.ty-klavye__sira--ust { padding-left: 4%; }
.ty-klavye__sira--ev { padding-left: 6%; }
.ty-klavye__sira--alt { padding-left: 9%; }
.ty-klavye__sira--bosluk { justify-content: center; }

.ty-tus {
    flex: 0 1 44px;
    min-width: 0;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: .9rem;
}

.ty-tus--bosluk { flex-basis: 45%; font-family: inherit; font-size: .78rem; }
.ty-tus--yok { color: color-mix(in srgb, var(--muted) 60%, transparent); border-style: dashed; }

.ty-tus--h0 { background: color-mix(in srgb, var(--ok) 22%, transparent); }
.ty-tus--h1 { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.ty-tus--h2 { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.ty-tus--h3 { background: color-mix(in srgb, var(--warn) 32%, transparent); }
.ty-tus--h4 { background: color-mix(in srgb, var(--bad) 30%, transparent); }
.ty-tus--h5 { background: color-mix(in srgb, var(--bad) 55%, transparent); color: #fff; }

/* -------------------------------------------------------------- antrenman */

.ty-antrenman {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.ty-grup--dersler { gap: 6px; }

.ty-ders-aciklama { margin: 0; font-size: .88rem; color: var(--muted); }

.ty-ozel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: .88rem;
}

.ty-ozel[hidden] { display: none; }

.ty-hedef {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: flex-end;
    font-size: .85rem;
}

.ty-hedef__cubuk,
.ty-katilimci__cubuk {
    width: 160px;
    height: 10px;
    border: 0;
    border-radius: 5px;
    overflow: hidden;
    background: var(--bg-3);
    accent-color: var(--brand);
    appearance: none;
}

.ty-hedef__cubuk::-webkit-progress-bar,
.ty-katilimci__cubuk::-webkit-progress-bar { background: var(--bg-3); }
.ty-hedef__cubuk::-webkit-progress-value,
.ty-katilimci__cubuk::-webkit-progress-value { background: var(--brand); border-radius: 5px; }
.ty-hedef__cubuk::-moz-progress-bar,
.ty-katilimci__cubuk::-moz-progress-bar { background: var(--brand); border-radius: 5px; }

.ty-hedef__cubuk { align-self: center; }
.ty-hedef__metin { align-self: center; }
.ty-hedef__seri { align-self: center; color: var(--warn); font-weight: 600; }

/* ----------------------------------------------------------------- yarış */

.ty-durum { margin: 0 0 12px; font-size: .88rem; color: var(--muted); }
.ty-durum:empty { display: none; }
.ty-durum--buyuk { font-size: 1.1rem; font-weight: 600; color: var(--text); }

.ty-lobi { display: flex; flex-direction: column; gap: 16px; }
.ty-lobi[hidden], .ty-oda[hidden], .ty-yaris-alan[hidden] { display: none; }

.ty-lobi__kartlar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.ty-kart {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.ty-kart__baslik { margin: 0; font-size: 1rem; }

.ty-kod-girdi {
    width: 9ch;
    font-family: var(--mono);
    font-size: 1.2rem;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.ty-oda { display: flex; flex-direction: column; gap: 14px; }

.ty-oda__ust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.ty-oda__kod { margin: 0; color: var(--muted); }

.ty-oda__kod strong {
    margin-left: 6px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 1.4rem;
    letter-spacing: .15em;
}

.ty-katilimcilar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ty-katilimci {
    display: grid;
    grid-template-columns: 2.2em minmax(0, 1.2fr) minmax(80px, 2fr) 5.5em auto;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-2);
    font-variant-numeric: tabular-nums;
}

.ty-katilimci.is-ben { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }
.ty-katilimci.is-ayrildi { opacity: .55; }
.ty-katilimci.is-bitti .ty-katilimci__cubuk::-webkit-progress-value { background: var(--ok); }
.ty-katilimci.is-bitti .ty-katilimci__cubuk::-moz-progress-bar { background: var(--ok); }

.ty-katilimci__sira { font-weight: 700; color: var(--brand-2); }
.ty-katilimci__ad { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.ty-katilimci__etiket {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--bg-3);
    font-size: .72rem;
    font-weight: 400;
    color: var(--muted);
}

.ty-katilimci__cubuk { width: 100%; }
.ty-katilimci__wpm { text-align: right; font-size: .88rem; }
.ty-katilimci__durum { font-size: .78rem; color: var(--muted); }

.ty-yaris-alan { display: flex; flex-direction: column; }

/* ------------------------------------------------------------ istatistik */

.ty-kayit-arac {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 10px;
}

.ty-dosya { position: relative; }

.ty-dosya:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }

.ty-dosya__girdi {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dt-btn.is-onay { background: var(--bad); border-color: var(--bad); color: #fff; }

.ty-bildirim {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 9px;
    background: var(--bg-2);
    font-size: .88rem;
}

.ty-bildirim[hidden], .ty-bos[hidden], .ty-istatistik[hidden] { display: none; }

.ty-bos {
    padding: 28px 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
}

.ty-istatistik { display: flex; flex-direction: column; gap: 18px; }

.ty-bolum {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.ty-bolum > h2 { margin: 0 0 12px; font-size: 1.05rem; }

.ty-ozet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 0;
}

.ty-ozet__oge {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
}

.ty-ozet__oge dt { font-size: .78rem; color: var(--muted); }
.ty-ozet__oge dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.ty-tablo-kap { overflow-x: auto; }

.ty-tablo {
    width: 100%;
    border-collapse: collapse;
    font-size: .86rem;
    white-space: nowrap;
}

.ty-tablo th,
.ty-tablo td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.ty-tablo th { font-weight: 600; color: var(--muted); font-size: .78rem; }
.ty-tablo .ty-tablo__sayi { text-align: right; font-variant-numeric: tabular-nums; }
.ty-tablo tr.is-sayilmadi td { color: var(--muted); }

/* ---------------------------------------------------- tanıtım ve bağlantılar */

.ty-aciklama { max-width: 780px; margin: 28px 0 0; }
.ty-aciklama h2 { margin: 0 0 8px; font-size: 1.1rem; }
.ty-aciklama p { margin: 0; color: var(--muted); line-height: 1.65; }

.ty-baglantilar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ty-baglantilar a {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    color: var(--text);
    text-decoration: none;
}

.ty-baglantilar a:hover { border-color: var(--brand); }
.ty-baglantilar span { font-size: .84rem; color: var(--muted); }

/* --------------------------------------------------------------- telefon */

@media (max-width: 640px) {
    .ty { --ty-yazi: 1.2rem; }
    .ty--boyut-kucuk { --ty-yazi: 1rem; }
    .ty--boyut-buyuk { --ty-yazi: 1.45rem; }

    .ty-secenekler { padding: 10px; gap: 8px; }
    .ty-grup__etiket { width: 100%; }
    .ty-alan { padding: 14px; }
    .ty-gosterge { gap: 18px; }
    .ty-gosterge__deger { font-size: 1.3rem; }
    .ty-sonuc { padding: 16px 14px; }
    .ty-bolum { padding: 14px 12px; }
    .ty-tus { height: 32px; font-size: .78rem; border-radius: 5px; }
    .ty-klavye__sira, .ty-klavye { gap: 3px; }

    .ty-katilimci {
        grid-template-columns: 2em minmax(0, 1fr) auto;
        row-gap: 6px;
    }

    .ty-katilimci__cubuk { grid-column: 1 / -1; grid-row: 2; }
    .ty-katilimci__durum { grid-column: 1 / -1; }
    .ty-katilimci__durum:empty { display: none; }
}
