/* Bileşenler: kart, düğme biçimleri, seçim çipleri, rozetler, zaman şeridi, pencereler, test ve arşiv parçaları.
   Temel (değişkenler, yazı, gövde, odak, düğme tabanı) css/theme.css'tedir; hareket css/motion.css'tedir. */

/* ——— Genel bileşenler ——— */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .92rem; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.field { width: 100%; max-width: 340px; min-height: 44px; padding: 10px 14px; border-radius: 999px; border: 1px solid #a98a4f; background: rgba(255, 250, 232, .75); color: #2b1b10; font: inherit; transition: border-color var(--d-ui) var(--ease-out), box-shadow var(--d-ui) var(--ease-out); }
.field:hover { border-color: #7a5a2b; }
.field:focus-visible { border-color: #7a5a2b; box-shadow: 0 0 0 3px rgba(201, 162, 75, .35); outline: none; }
/* Kaynak rozetleri: en küçük yazı 12 px'in altına inmez (okunabilirlik). */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 3px; font: 700 .75rem/1.5 var(--font-head); letter-spacing: .05em; border: 1px solid currentColor; }
.b-src { color: #2c5f43; }
.b-gen { color: #7a5718; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.srcline { font-size: .82rem; color: var(--muted); margin-top: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 22px; }
.toolbar .lbl { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.learned { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: .84rem; font-weight: 600; }
.learned[aria-pressed="true"] { background: var(--ok); color: #fff; border-color: var(--ok); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* ——— Zaman çizelgesi ——— */
.tl { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--dotc, var(--ink)); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line); }
.tl-card { padding: 0; overflow: hidden; }
.tl-head { width: 100%; text-align: left; background: none; border: 0; padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; }
.tl-date { font-size: .82rem; font-weight: 700; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-cat { color: var(--dotc); }
.tl-title { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; grid-column: 1; }
.tl-sum { grid-column: 1 / -1; color: var(--muted); font-size: 1rem; }
.chev { transition: transform .25s; grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 1.1rem; color: var(--muted); }
.tl-item.open .chev { transform: rotate(180deg); }
.tl-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.tl-item.open .tl-body { grid-template-rows: 1fr; }
.tl-body > div { overflow: hidden; visibility: hidden; transition: visibility 0s linear .3s; }
.tl-item.open .tl-body > div { visibility: visible; transition-delay: 0s; }
.tl-inner { padding: 0 18px 18px; border-top: 1px dashed var(--line); margin-top: 0; padding-top: 14px; }
.tl-inner ul { margin: 0 0 12px; padding-left: 1.2em; }
.tl-inner li { margin-bottom: 6px; }
.why { background: var(--surface-2); border-left: 4px solid var(--dotc, var(--red)); padding: 10px 14px; border-radius: 0 10px 10px 0; font-weight: 600; margin: 10px 0; }
.why small { display: block; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.row-actions.flush { margin-top: 0; }
.phase-title { font: 700 .8rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px -26px; padding-left: 26px; }

/* ——— Savaşlar ——— */
.bcard { padding: 18px; display: flex; flex-direction: column; gap: 8px; text-align: left; transition: transform .2s, box-shadow .2s; cursor: pointer; }
.bcard:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 14px 30px rgba(29, 36, 51, .14); }
.bcard h3 { font-size: 1.2rem; }
.bcard .dt { font-size: .84rem; font-weight: 700; color: var(--muted); }
.bcard p { color: var(--muted); font-size: .96rem; margin: 0; flex: 1; }
.res { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; width: fit-content; background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); border: 1px solid var(--tone); }
.tone-ok { --tone: var(--ok); } .tone-warn { --tone: var(--warn); } .tone-bad { --tone: var(--bad); }
dialog { border: 0; padding: 0; background: transparent; max-width: min(760px, 96vw); width: 100%; color: var(--ink); }
dialog::backdrop { background: rgba(10, 12, 18, .6); backdrop-filter: blur(3px); }
.dlg { color: var(--ink); background: linear-gradient(rgba(244, 232, 196, .7), rgba(244, 232, 196, .7)), #ead9ad url("../assets/img/parch.webp") center / cover; background-blend-mode: normal, multiply; border: 3px double #7a5a2b; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); max-height: 90vh; overflow: auto; }
.dlg-head { padding: 22px 24px 8px; position: sticky; top: 0; background: #e4d09c; z-index: 2; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 1.55rem; padding-right: 46px; }
.dlg-x { position: absolute; right: 16px; top: 16px; }
.tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 8px 14px; border: 0; background: none; border-bottom: 3px solid transparent; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--red); }
.dlg-body { padding: 18px 24px 26px; }
.sides { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.side { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.side h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: var(--font-body); margin-bottom: 6px; }
.person { padding: 8px 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person b { display: block; }
.person span { font-size: .88rem; color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.steps li::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 2px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.bars { display: grid; gap: 14px; margin-top: 6px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 700; margin-bottom: 4px; }
.bar-pair { display: grid; gap: 4px; }
.bar-line { height: 20px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: flex; align-items: center; }
.bar-line i { display: block; height: 100%; border-radius: 6px; width: 0; transition: width .7s cubic-bezier(.2, .8, .2, 1); display: flex; align-items: center; justify-content: flex-end; padding-right: 7px; font-style: normal; font-size: .75rem; font-weight: 700; color: #fff; min-width: 2px; }
.bar-line.tr i { background: var(--c-orgut); } .bar-line.gr i { background: var(--c-isgal); }
.bar-line { position: relative; }
.bar-line .zl { margin-left: 8px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.bar-legend { display: flex; gap: 14px; font-size: .84rem; color: var(--muted); }
.note { font-size: .84rem; color: var(--muted); border-left: 3px solid var(--warn); padding-left: 10px; margin-top: 10px; }

/* ——— Birlikler ——— */
.ucard { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 16px 18px; border-top: 4px solid var(--uc); cursor: pointer; text-align: left; width: 100%; transition: transform .2s; }
.ucard:hover { transform: translateY(-2px); }
.ucard h3 { font-size: 1.1rem; margin-bottom: 2px; }
.ucard .when { font-size: .8rem; color: var(--muted); font-weight: 700; }
.ucard .more { display: none; margin-top: 10px; font-size: .95rem; }
.ucard[aria-expanded="true"] .more { display: block; }
.ucard .tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--uc); }
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.cmp th, .cmp td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: .96rem; }
.cmp thead th { background: var(--surface-2); font-family: var(--font-head); }
.cmp tbody th { font-weight: 700; width: 18%; color: var(--muted); font-family: var(--font-body); }
.cmp tr:last-child > * { border-bottom: 0; }
.cmp td.hl { background: color-mix(in srgb, var(--c-orgut) 10%, transparent); }
.subhead { font-size: 1.4rem; margin: 36px 0 6px; }
.subnote { color: var(--muted); margin-bottom: 16px; max-width: 64ch; }
.tree { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); align-items: start; }
.tree ul { list-style: none; margin: 0; padding-left: 22px; position: relative; }
.tree > .tbox > ul { padding-left: 0; }
.tree ul ul::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 18px; width: 2px; background: var(--line); }
.tree li { position: relative; padding: 6px 0 6px 0; }
.tree ul ul > li::before { content: ""; position: absolute; left: -14px; top: 28px; width: 14px; height: 2px; background: var(--line); }
.node { display: flex; flex-direction: column; text-align: left; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 220px; }
.node b { font-family: var(--font-head); font-size: 1.02rem; }
.node small { color: var(--muted); }
.node.on { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.node.g { border-style: dashed; }
.tinfo { padding: 18px; position: sticky; top: 76px; }

/* ——— Strateji ——— */
.scard { padding: 18px; text-align: left; display: flex; flex-direction: column; gap: 6px; position: relative; }
.scard .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 1.3rem; }
.scard h3 { font-size: 1.15rem; margin-top: 6px; }
.scard .tg { font-size: .8rem; font-weight: 700; color: var(--red); }
.scard .sh { color: var(--muted); }
.scard .det { display: none; margin-top: 8px; }
.scard.open .det { display: block; }
.scard .sdiag { width: 100%; height: auto; aspect-ratio: 2 / 1; margin: -4px 0 4px; background: rgba(255, 248, 228, .55); border: 1px solid rgba(90, 61, 27, .25); border-radius: 8px; }
.scard .sd-t { font: 600 9.5px var(--font-body); paint-order: stroke; stroke: rgba(250, 240, 214, .9); stroke-width: 2.6px; stroke-linejoin: round; }
.scard .row-actions { margin-top: 6px; }
.scard .sd-w { font: 700 10px var(--font-body); fill: #fff; }
.scard blockquote { margin: 10px 0 0; padding: 10px 14px; border-left: 4px solid var(--red); background: var(--surface-2); font-family: var(--font-head); font-style: italic; border-radius: 0 10px 10px 0; }
.scn { padding: 22px; margin-top: 18px; }
.scn-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.scn h3 { font-size: 1.45rem; margin: 4px 0 8px; }
.opts { display: grid; gap: 10px; margin: 16px 0; }
.opt { text-align: left; padding: 13px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 600; display: flex; gap: 12px; align-items: flex-start; }
.opt:hover:not([disabled]) { border-color: var(--ink); }
.opt .k { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .85rem; }
.opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.opt.picked-real::after { content: "Tarihte seçilen yol"; margin-left: auto; font-size: .75rem; color: var(--ok); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.reveal { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }

/* ——— Teçhizat ——— */
.ecard { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ecard .top { display: flex; align-items: center; gap: 12px; }
.eic { width: 60px; height: 60px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); flex: none; overflow: hidden; }
.eic svg { width: 48px; height: 48px; display: block; }
.ecard h3 { font-size: 1.1rem; }
.sidetag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sidetag.tr { color: var(--c-orgut); } .sidetag.gr { color: var(--c-isgal); } .sidetag.both { color: var(--muted); }
.ecard .stat { margin-top: auto; padding-top: 10px; font: 800 1.25rem var(--font-head); color: var(--ink); }
.ecard .role { font-size: .92rem; color: var(--muted); }
.power { padding: 22px; margin-bottom: 26px; }
.power h3 { font-size: 1.4rem; margin-bottom: 4px; }

.stamp { display: inline-block; border: 2px solid var(--red); color: var(--red); padding: 2px 10px; border-radius: 6px; font: 700 .78rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; transform: rotate(-2deg); }
.kunye { font-size: .84rem; color: var(--muted); font-family: var(--font-body); border-top: 1px dashed #c9bc98; padding-top: 8px; }

/* ——— Öğren ——— */
.qmeta { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.qprog { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin-bottom: 16px; }
.qprog i { display: block; height: 100%; background: var(--red); width: 0; transition: width .3s; }
.qq, .sheet .qq { font-family: var(--font-head); font-size: 1.4rem; font-weight: 400; line-height: 1.6; margin-bottom: 14px; color: var(--ink); }
.score { text-align: center; padding: 20px 0; }
.score .big { font: 800 4rem var(--font-head); color: var(--red); line-height: 1; }
.ord-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 16px 0; }
.ord { text-align: left; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); position: relative; min-height: 78px; }
.ord b { font-family: var(--font-head); }
.ord small { display: block; color: var(--muted); }
.ord:hover:not(.done) { border-color: var(--ink); }
.ord.done { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.ord .no { position: absolute; right: 10px; top: 8px; font: 800 1.3rem var(--font-head); color: var(--ok); }
.ord.shake { animation: shake .35s; border-color: var(--bad); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.flash { perspective: 900px; min-height: 190px; }
.flip { position: relative; width: 100%; min-height: 190px; border: 0; background: none; padding: 0; transform-style: preserve-3d; transition: transform .5s; }
.flip.on { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 22px; text-align: center; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.face.back { transform: rotateY(180deg); background: var(--ink); color: var(--bg); }
.face.front b { font: 700 1.6rem var(--font-head); }
.face small { opacity: .7; margin-top: 12px; }
.gloss-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 18px; }
.gloss-list .g { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.gloss-list b { display: block; font-family: var(--font-head); }
.gloss-list span { font-size: .9rem; color: var(--muted); }



@media (max-width: 900px) {
  .tree { grid-template-columns: 1fr; }
  .tinfo { position: static; }
}
@media (max-width: 640px) {
  .sides { grid-template-columns: 1fr; }
  .cmp thead { display: none; }
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; width: 100%; }
  .cmp tbody th { width: auto; background: var(--surface-2); border-bottom: 0; }
  .cmp td::before { content: attr(data-l); display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .tl-title { font-size: 1.12rem; }
  .node { min-width: 0; }
}
