/* =====================================================================
   ŞABO TV — Kadro Kur
   Yayın grafiği gibi bir "ilk 11" tahtası: eğik kesimli bant, saha, yedek kulübesi.
   Oyuncu ölçüleri tahtanın genişliğine göre büyür-küçülür (container query birimleri): saha daralınca formalar da
   küçülür, isim plakaları birbirine girmez. Sürüklenirken <body>'ye eklenen görüntüye ölçüler JS ile yazılır.
   ===================================================================== */
:root {
  --tok: 48px;      /* forma */
  --tokw: 100px;    /* oyuncunun kapladığı genişlik (isim plakası dahil) */
  --tokf: 13px;     /* isim yazısı */
}
.kd-board { container-type: inline-size; }
.kd-chip { --tok: 38px; --tokw: 76px; --tokf: 11.5px; }
@media (max-width: 560px) { :root { --tok: 36px; --tokw: 62px; --tokf: 10.5px; } .kd-chip { --tok: 31px; --tokw: 58px; --tokf: 10px; } }
@supports (width: 1cqw) {
  /* pages/kadro.js içindeki ghostSizes() bu değerlerin aynısını kullanır */
  .kd-board .kd-tok { --tok: clamp(34px, 8.3cqw, 52px); --tokw: clamp(58px, 17.6cqw, 110px); --tokf: clamp(10.5px, 2.25cqw, 13.5px); }
  .kd-board .kd-chip { --tok: clamp(30px, 6.3cqw, 40px); --tokw: clamp(54px, 12.6cqw, 80px); --tokf: clamp(10px, 1.9cqw, 11.5px); }
}

/* ------------------------------------------------------------------ sayfa başlığı */
.kd-hero { position: relative; padding: 26px 0 18px; border-bottom: 1px solid var(--line); overflow: hidden; background: linear-gradient(100deg, rgba(125, 29, 63, .24), transparent 58%); }
.kd-hero::before { content: ''; position: absolute; right: -70px; top: -50px; width: 480px; height: 220px; background: var(--stripe); opacity: .08; transform: skewX(-20deg); pointer-events: none; }
.kd-hero-in { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.kd-hero h1 { margin-top: 8px; font-size: clamp(34px, 4.4vw, 58px); font-style: italic; line-height: .95; }
.kd-hero h1 em { font-style: italic; color: var(--mavi); }
.kd-hero p { max-width: 470px; margin: 0; font-size: 15.5px; }
.kd-view .kd-hero h1 { font-size: clamp(28px, 3.6vw, 46px); overflow-wrap: anywhere; }
.kd-loading { padding-top: 30px; padding-bottom: 30px; }
.kd-fatal { max-width: 560px; margin: 60px auto; }
@media (max-width: 760px) { .kd-hero { padding: 18px 0 14px; } .kd-hero-in { flex-direction: column; align-items: flex-start; gap: 10px; } .kd-hero p { font-size: 14.5px; } }

/* ------------------------------------------------------------------ yerleşim */
.kd-app { padding: 22px 0 10px; }
/* Dar masaüstünde önce yan panel daralır (340px'e kadar), saha olabildiğince büyük kalır */
.kd-grid { display: flex; gap: 26px; justify-content: center; align-items: flex-start; }
.kd-stage { flex: 0 1 640px; min-width: 0; }
/* iki sütunlu görünümde saha ekran yüksekliğine sığar: araç çubuğu, bant ve saha kaydırmadan birlikte görünsün */
@media (min-width: 981px) { .kd-stage { max-width: min(640px, max(440px, calc((100vh - 262px) * .8095))); } }
.kd-side-slot, .kd-grid > .kd-view-side { flex: 0 4 470px; min-width: 340px; }
@media (max-width: 980px) {
  .kd-grid { flex-direction: column; align-items: stretch; gap: 22px; }
  .kd-stage, .kd-side-slot, .kd-grid > .kd-view-side { flex: none; width: 100%; max-width: 640px; min-width: 0; margin: 0 auto; }
}

/* ------------------------------------------------------------------ araç çubuğu */
.kd-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.kd-bar-tools { display: inline-flex; gap: 2px; margin-left: auto; }
.kd-fbtn { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); transition: border-color .15s; }
.kd-fbtn small { font: 600 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kd-fbtn b { font: 800 20px/1 var(--display); font-style: italic; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.kd-fbtn svg { width: 15px; height: 15px; color: var(--muted); }
.kd-fbtn:hover { border-color: var(--mavi); }
@media (max-width: 430px) { .kd-bar { gap: 6px; } .kd-fbtn { padding: 0 8px 0 10px; gap: 6px; } .kd-fbtn small { display: none; } .kd-bar .btn-line { padding: 0 12px; } .kd-bar-tools .btn-icon { width: 36px; } }

/* ------------------------------------------------------------------ tahta: bant */
.kd-board { position: relative; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.kd-band { position: relative; display: flex; align-items: stretch; gap: 14px; min-height: 76px; padding: 0 14px 0 0; background: linear-gradient(100deg, var(--bordo-ink) 0%, var(--panel) 48%, var(--ink-2) 100%); }
.kd-band::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--bordo-3) 0 50%, var(--mavi) 50% 100%); }
.kd-band-form { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 116px; padding: 8px 30px 8px 16px; border: 0; background: linear-gradient(180deg, var(--bordo-2), var(--bordo)); color: #fff; text-align: left; clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
.kd-band-form small { font: 700 10px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; opacity: .78; }
.kd-band-form b { font: 800 30px/1 var(--display); font-style: italic; letter-spacing: .01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
button.kd-band-form { transition: filter .15s; }
button.kd-band-form:hover { filter: brightness(1.14); }
button.kd-band-form:focus-visible { outline-offset: -3px; outline-color: #fff; }
.kd-band-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 9px 0; }
.kd-in { width: 100%; min-width: 0; padding: 2px 0; background: transparent; border: 0; border-bottom: 1px dashed transparent; border-radius: 0; color: var(--text); font: 600 14px/1.25 var(--font); }
input.kd-in:hover { border-bottom-color: var(--line-2); }
input.kd-in:focus { outline: none; border-bottom-color: var(--mavi); }
.kd-in::placeholder { color: var(--faint); opacity: 1; }
.kd-in-title { font: 800 26px/1.1 var(--display); font-style: italic; text-transform: uppercase; letter-spacing: .01em; }
.kd-band-sub { display: flex; align-items: center; gap: 8px; }
.kd-band-sub .kd-in { color: var(--text-2); }
.kd-td { flex: none; padding: 3px 5px 2px; border-radius: 2px; background: var(--panel-3); color: var(--mavi); font: 700 10.5px/1 var(--display); letter-spacing: .12em; }
.kd-band-logo { align-self: center; flex: none; height: 26px; }
.kd-band-logo .l1, .kd-band-logo .l2 { font-size: 18px; padding: 0 10px; clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
.kd-band-logo .l2 { margin-left: -3px; padding: 0 9px; }
.kd-band-form.static { cursor: default; }
.kd-in.static { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kd-band-sub.static { color: var(--text-2); font: 600 14px/1.25 var(--font); min-width: 0; }
.kd-band-sub.static span:not(.kd-td) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .kd-band { gap: 10px; padding-right: 10px; min-height: 68px; }
  .kd-band-form { min-width: 92px; padding: 8px 22px 8px 12px; }
  .kd-band-form b { font-size: 24px; }
  .kd-in-title { font-size: 20px; }
  .kd-in { font-size: 13px; }
}

/* ------------------------------------------------------------------ yönlendirme şeridi */
.kd-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 7px 14px; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; line-height: 1.35; }
@container (max-width: 520px) { .kd-hint { min-height: 62px; padding: 7px 12px; font-size: 13px; } }
@container (max-width: 600px) { .kd-band-logo { display: none; } }
.kd-hint b { color: #fff; font-weight: 600; }
.kd-hint > span:first-child { flex: 1; min-width: 0; }
.kd-hint > .btn { flex: none; }
.kd-hint.on { background: linear-gradient(90deg, rgba(232, 182, 76, .17), var(--panel) 72%); color: var(--text); box-shadow: inset 3px 0 0 var(--gold); }
.kd-hint-btns { flex: none; display: inline-flex; gap: 6px; }

/* ------------------------------------------------------------------ saha */
.kd-pitch { position: relative; width: 100%; aspect-ratio: 68 / 84; overflow: hidden; background: #123f26; user-select: none; -webkit-user-select: none; }
.kd-pitch::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(110% 70% at 50% 42%, rgba(255, 255, 255, .06), transparent 58%), radial-gradient(95% 75% at 50% 50%, transparent 52%, rgba(0, 0, 0, .4)); }
.kd-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* oyuncu */
.kd-tok { position: absolute; z-index: 2; width: var(--tokw); margin: 0; padding: 0; border: 0; background: none; color: #fff; transform: translate(-50%, -50%); cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.kd-tok-in { display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.kd-kit { position: relative; display: block; width: var(--tok); height: var(--tok); transition: transform .15s; }
.kd-shirt { display: block; width: 100%; height: 100%; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .5)); }
.kd-tok-crest { position: absolute; right: -5px; bottom: 1px; width: calc(var(--tok) * .36); height: auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .65)); }
.kd-cap { position: absolute; left: -6px; top: -3px; display: flex; align-items: center; justify-content: center; width: calc(var(--tok) * .38); height: calc(var(--tok) * .38); border-radius: 50%; background: var(--gold); color: #1d1404; font: 800 calc(var(--tok) * .26)/1 var(--display); box-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.kd-cap.inline { position: static; display: inline-flex; width: 17px; height: 17px; margin-left: 5px; font-size: 11px; vertical-align: 1px; box-shadow: none; }
.kd-name { max-width: 100%; padding: 3px 9px 3px; background: rgba(7, 9, 13, .9); box-shadow: inset 0 -2px 0 var(--mavi); color: #fff; font: 700 var(--tokf)/1.1 var(--display); letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.kd-tok.cap .kd-name { box-shadow: inset 0 -2px 0 var(--gold); }
/* sahada uzun soyad plakası oyuncunun genişliğini biraz aşabilir (iki yana eşit taşar); yedek kulübesinde aşmaz */
.kd-tok .kd-name { width: max-content; max-width: calc(var(--tokw) * 1.3); }
.kd-name.l1 { font-size: calc(var(--tokf) * .9); letter-spacing: .01em; }
.kd-name.l2 { font-size: calc(var(--tokf) * .82); letter-spacing: 0; padding-left: 7px; padding-right: 7px; }
.kd-meta { font: 600 calc(var(--tokf) - 2.5px)/1 var(--display); letter-spacing: .08em; color: rgba(255, 255, 255, .88); text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 6px rgba(0, 0, 0, .6); white-space: nowrap; }
.kd-plus { display: flex; align-items: center; justify-content: center; width: calc(var(--tok) * .84); height: calc(var(--tok) * .84); border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .28); color: rgba(255, 255, 255, .88); transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.kd-plus svg { width: 46%; height: 46%; }
.kd-role { margin-top: 2px; font: 700 calc(var(--tokf) - 1px)/1 var(--display); letter-spacing: .1em; color: rgba(255, 255, 255, .82); text-shadow: 0 1px 3px rgba(0, 0, 0, .85); white-space: nowrap; }
button.kd-tok.empty:hover .kd-plus { border-color: #fff; background: rgba(0, 0, 0, .46); transform: scale(1.07); }
button.kd-tok.filled:hover .kd-kit { transform: translateY(-2px) scale(1.05); }
.kd-tok:focus-visible, .kd-chip:focus-visible { outline: none; }
.kd-tok:focus-visible .kd-plus, .kd-tok:focus-visible .kd-name, .kd-chip:focus-visible .kd-plus, .kd-chip:focus-visible .kd-name { outline: 2px solid var(--mavi); outline-offset: 2px; }
.kd-tok.empty.sel .kd-plus { border-style: solid; border-color: var(--gold); color: var(--gold); animation: kdPulse 1.4s infinite; }
.kd-tok.filled.sel .kd-shirt, .kd-tok.mv .kd-shirt, .kd-chip.mv .kd-shirt { filter: drop-shadow(0 0 7px var(--gold)) drop-shadow(0 5px 5px rgba(0, 0, 0, .5)); }
.kd-tok.mv .kd-kit, .kd-chip.mv .kd-kit { animation: kdBob .7s ease-in-out infinite alternate; }
.kd-pitch.moving .kd-tok.empty .kd-plus, .kd-bench.moving .kd-chip.add .kd-plus { border-color: var(--gold); color: var(--gold); }
.kd-pitch.free button.kd-tok, .kd-pitch button.kd-tok.filled { cursor: grab; }
.kd-board.readonly .kd-tok, .kd-board.readonly .kd-chip { cursor: default; touch-action: auto; }
@keyframes kdPulse { 0% { box-shadow: 0 0 0 0 rgba(232, 182, 76, .55); } 70% { box-shadow: 0 0 0 12px rgba(232, 182, 76, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 182, 76, 0); } }
@keyframes kdBob { from { transform: translateY(0); } to { transform: translateY(-4px); } }

/* sürükleme */
.kd-drag-src { opacity: .32; }
.kd-ghost { position: fixed !important; left: 0 !important; top: 0 !important; z-index: 400; margin: 0 !important; pointer-events: none; will-change: transform; }
.kd-ghost .kd-kit { transform: scale(1.14) rotate(-5deg); }
.kd-ghost .kd-shirt { filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .55)); }
.kd-tok.kd-over .kd-plus { border-style: solid; border-color: var(--mavi); background: rgba(95, 182, 232, .28); transform: scale(1.16); }
.kd-tok.kd-over .kd-kit, .kd-chip.kd-over .kd-kit { transform: scale(1.14); }
.kd-tok.kd-over .kd-shirt, .kd-chip.kd-over .kd-shirt { filter: drop-shadow(0 0 8px var(--mavi)) drop-shadow(0 5px 5px rgba(0, 0, 0, .5)); }
html.kd-dragging, html.kd-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.kd-trash { position: fixed; left: 50%; bottom: 18px; z-index: 160; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--bad-ink); border: 1px dashed var(--bad); border-radius: 8px; color: #ffc9cd; font: 600 14px/1.2 var(--font); white-space: nowrap; pointer-events: none; transform: translate(-50%, 160%); transition: transform .18s; }
.kd-trash.on { transform: translate(-50%, 0); pointer-events: auto; }
.kd-trash.kd-over { background: var(--bad); border-style: solid; color: #fff; }
@media (max-width: 430px) { .kd-trash { left: 12px; right: 12px; transform: translateY(160%); white-space: normal; } .kd-trash.on { transform: none; } }

/* ------------------------------------------------------------------ yedek kulübesi */
.kd-bench { padding: 10px 12px 12px; background: var(--panel); border-top: 1px solid var(--line); }
.kd-bench-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.kd-bench-t { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--mavi); }
.kd-bench-t::before { content: ''; width: 9px; height: 12px; background: var(--bordo-3); transform: skewX(-18deg); }
.kd-bench-n { font: 600 12px/1 var(--display); letter-spacing: .06em; color: var(--muted); }
.kd-bench-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 2px; min-height: 58px; border-radius: 8px; transition: background .15s; }
.kd-bench-list.sel { outline: 2px dashed var(--gold); outline-offset: 4px; }
.kd-bench-list.kd-over, .kd-bench.moving .kd-bench-list { outline: 2px dashed var(--mavi); outline-offset: 4px; background: rgba(95, 182, 232, .06); }
.kd-chip { position: relative; width: var(--tokw); padding: 2px 0; border: 0; background: none; color: #fff; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
button.kd-chip:hover .kd-kit { transform: translateY(-2px) scale(1.05); }
.kd-chip.add { display: flex; flex-direction: column; align-items: center; gap: 2px; touch-action: manipulation; }
.kd-chip.add .kd-role { letter-spacing: .06em; text-shadow: none; color: var(--muted); }
.kd-chip.add:hover .kd-plus { border-color: #fff; }
.kd-bench-tip { align-self: center; max-width: 280px; margin-left: 8px; font-size: 12.5px; line-height: 1.35; color: var(--faint); }

/* ------------------------------------------------------------------ paylaşım düğmeleri */
.kd-cta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.kd-cta-n { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font: 700 13px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kd-cta-n.ok { color: var(--ok); }
.kd-cta-n svg { width: 15px; height: 15px; }
@media (max-width: 620px) {
  .kd-cta .btn-lg { flex: 1 1 auto; height: 46px; padding: 0 16px; font-size: 15px; }
  .kd-cta .btn-cut { padding: 0 24px; }
  .kd-cta-n { order: -1; width: 100%; margin: 0; }
}

/* ------------------------------------------------------------------ yan panel */
.kd-side { position: sticky; top: calc(var(--header-h) + 14px); display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - 28px); min-height: 460px; max-height: 900px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kd-sheet-head { display: none; }
.kd-tabs { flex: none; display: flex; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.kd-tabs button { position: relative; flex: 1; height: 44px; padding: 0 6px; background: none; border: 0; color: var(--muted); font: 700 13.5px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.kd-tabs button:hover { color: var(--text); }
.kd-tabs button.active { color: #fff; }
.kd-tabs button.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--bordo-3); transform: skewX(-30deg); }
.kd-tabs button:focus-visible { outline-offset: -3px; }
.kd-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.kd-pane[data-t="oyuncular"] { overflow: hidden; }
.kd-pane > * { flex: none; }

.kd-search { position: relative; }
.kd-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.kd-search .input { height: 44px; padding-left: 38px; }
.kd-clubs { display: flex; flex-wrap: wrap; gap: 4px; }
.kd-club { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 38px; padding: 0; background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; color: var(--text-2); opacity: .74; transition: opacity .12s, border-color .12s, background .12s; }
.kd-club.all { width: auto; padding: 0 10px; font: 700 12px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.kd-club:hover { opacity: 1; border-color: var(--line-2); }
.kd-club.active { opacity: 1; background: var(--panel-3); border-color: var(--mavi); box-shadow: inset 0 -3px 0 var(--mavi); color: #fff; }
/* arama sürerken kulüp seçimi listeyi daraltmaz; seçili kulüp yalnızca öne alınır */
.kd-searching .kd-clubs { opacity: .45; }
.kd-filter .seg { display: flex; width: 100%; }
.kd-filter .seg button { flex: 1; padding: 0 4px; white-space: nowrap; }
.kd-list-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: -6px; font: 600 11.5px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kd-lh-t { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-lh-t em { font-style: normal; color: var(--gold); }
.kd-lh-n { white-space: nowrap; }
.kd-lh-g { width: 30px; margin-right: 38px; text-align: right; cursor: help; border-bottom: 1px dotted var(--faint); }
.kd-pane > .kd-list { flex: 1 1 auto; }
.kd-list { min-height: 0; margin: 0 -14px; padding: 0 14px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kd-row { display: flex; align-items: stretch; border-bottom: 1px solid rgba(255, 255, 255, .045); touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.kd-row:last-child { border-bottom: 0; }
.kd-row-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 40px 20px minmax(0, 1fr) auto 30px; align-items: center; gap: 8px; padding: 7px 8px 7px 0; background: none; border: 0; color: var(--text); text-align: left; }
.kd-row-main:hover { background: rgba(255, 255, 255, .035); }
.kd-row-main:focus-visible, .kd-row-b:focus-visible, .kd-more:focus-visible { outline-offset: -2px; }
.kd-pos { display: inline-block; min-width: 38px; padding: 4px 4px 3px; border-radius: 3px; text-align: center; font: 700 11.5px/1 var(--display); letter-spacing: .06em; }
.kd-pos.GK { background: #e8b64c; color: #1d1404; }
.kd-pos.DEF { background: #2d6fb3; color: #fff; }
.kd-pos.MID { background: #2f9e64; color: #fff; }
.kd-pos.ATT { background: #b8323e; color: #fff; }
.kd-row-no { font: 700 14px/1 var(--display); color: var(--muted); text-align: right; }
.kd-row-n { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kd-row-n b { font-weight: 600; font-size: 14.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kd-row-n small { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; line-height: 1.15; color: var(--muted); }
.kd-row-n small span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kd-row-n small .crest { flex: none; }
.kd-row-g { font: 700 13px/1 var(--display); color: var(--faint); text-align: right; }
.kd-fit, .kd-used { padding: 3px 5px 2px; border-radius: 2px; font: 700 10px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.kd-fit.f2 { background: var(--ok-ink); color: var(--ok); }
.kd-fit.f1 { background: rgba(242, 169, 59, .14); color: var(--warn); }
.kd-used { background: var(--panel-3); color: var(--mavi); }
.kd-row.used .kd-row-n b, .kd-row.used .kd-row-no { color: var(--muted); }
.kd-row.dim .kd-row-main { opacity: .6; }
.kd-row-b { flex: none; display: flex; align-items: center; justify-content: center; width: 38px; background: none; border: 0; border-left: 1px solid rgba(255, 255, 255, .045); color: var(--faint); }
.kd-row-b:hover { background: rgba(95, 182, 232, .08); color: var(--mavi); }
.kd-row-b:disabled { opacity: .3; pointer-events: none; }
.kd-more { width: 100%; padding: 12px; background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, .045); color: var(--mavi); font: 600 13.5px/1.25 var(--font); text-align: center; }
.kd-more:hover { color: var(--mavi-2); background: rgba(255, 255, 255, .03); }
.kd-list-empty { padding: 34px 10px; }
.kd-custom { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; background: var(--ink-2); border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--text-2); font-size: 13.5px; text-align: left; }
.kd-custom b { color: #fff; font-weight: 600; }
.kd-custom:hover { border-color: var(--mavi); }
.kd-custom svg { color: var(--mavi); }

/* görünüm sekmesi */
.kd-opt h5, .kd-forms h5, .kd-quick h5, .kd-vl h5 { margin: 0 0 8px; font: 700 12px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.kd-opt + .kd-opt { padding-top: 14px; border-top: 1px solid var(--line); }
.kd-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.kd-pane > .kd-note { margin: 0; }
.kd-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kd-swatch { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 7px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); font: 600 12px/1.15 var(--font); text-align: center; }
.kd-swatch i { display: block; height: 44px; border-radius: 4px; }
.kd-swatch:hover { border-color: var(--line-2); }
.kd-swatch.active, .kd-kit-pre.active { border-color: var(--mavi); box-shadow: 0 0 0 1px var(--mavi); color: #fff; }
.kd-seg-full { display: flex; width: 100%; }
.kd-seg-full button { flex: 1; }
.kd-kits { display: flex; gap: 8px; margin-top: 10px; }
.kd-kit-pre { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; padding: 0; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; }
.kd-kit-pre .kd-shirt { width: 40px; height: 40px; filter: none; }
.kd-colors { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
.kd-colors label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.kd-colors input { width: 40px; height: 30px; padding: 0; background: none; border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer; }
.kd-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.kd-switches .switch { font-size: 14px; }
@media (max-width: 430px) { .kd-switches { grid-template-columns: 1fr; } }

/* kayıtlı kadrolar */
.kd-saved { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.kd-saved-item { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.kd-saved-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 11px 0; background: none; border: 0; color: var(--text); text-align: left; }
.kd-saved-open b { font: 700 16px/1.1 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kd-saved-open span { font-size: 12.5px; color: var(--muted); }
.kd-saved-open:hover b { color: var(--mavi); }
.kd-saved-empty { padding: 26px 8px; }

/* telefon: yan panel akışta durur; mevkiye dokununca alttan açılır */
.kd-backdrop { display: none; }
html.kd-lock, html.kd-lock body { overflow: hidden; }
@media (max-width: 980px) {
  .kd-side { position: static; height: auto; min-height: 0; max-height: none; }
  .kd-pane { overflow: visible; }
  .kd-pane[data-t="oyuncular"] { overflow: visible; }
  .kd-list { max-height: 62vh; }
  /* kulüp armaları tek sıra, yana kaydırılır: listeye yer kalsın */
  .kd-clubs { flex-wrap: nowrap; margin: 0 -14px; padding: 0 14px 2px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .kd-clubs::-webkit-scrollbar { display: none; }
  .kd-club { flex: none; }
  .kd-sheet-open .kd-backdrop { display: block; position: fixed; inset: 0; z-index: 140; background: rgba(4, 5, 8, .72); animation: fadeIn .15s; }
  .kd-sheet-open .kd-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; width: 100%; max-width: 640px; height: 84vh; height: min(84dvh, 760px); margin: 0 auto; border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); animation: kdSheet .24s cubic-bezier(.2, .8, .2, 1); }
  .kd-sheet-open .kd-sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); background: var(--ink-2); }
  .kd-sheet-open .kd-sheet-head b { font: 700 17px/1.1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
  .kd-sheet-open .kd-tabs { display: none; }
  .kd-sheet-open .kd-pane { overflow: hidden; }
  .kd-sheet-open .kd-list { max-height: none; }
}
@keyframes kdSheet { from { transform: translateY(40%); opacity: .4; } }

/* ------------------------------------------------------------------ oyuncu menüsü */
.kd-menu { position: fixed; z-index: 180; min-width: 224px; max-width: 290px; padding: 5px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); animation: popIn .12s; }
.kd-menu-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; padding: 8px 10px 9px; border-bottom: 1px solid var(--line); }
.kd-menu-head b { font: 700 16px/1.1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.kd-menu-head span { font-size: 12px; color: var(--muted); }
.kd-menu-head span:empty { display: none; }
.kd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; background: none; border: 0; border-radius: 4px; color: var(--text-2); font-size: 14px; text-align: left; }
.kd-menu button:hover, .kd-menu button:focus-visible { outline: none; background: var(--panel-3); color: #fff; }
.kd-menu button.danger { color: #f4898f; }
.kd-menu button:disabled { opacity: .4; pointer-events: none; }
.kd-menu svg { flex: none; width: 16px; height: 16px; }

/* ------------------------------------------------------------------ pencereler */
.modal.kd-modal { max-width: 540px; }
.modal.wide.kd-modal { max-width: 720px; }
.kd-forms .kd-note, .kd-quick > .kd-note { margin: 0 0 16px; }
.kd-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-bottom: 18px; }
.kd-form { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 9px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); transition: border-color .12s, background .12s; }
.kd-form b { font: 800 16px/1 var(--display); font-style: italic; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.kd-form:hover { border-color: var(--line-2); color: #fff; }
.kd-form.active { background: var(--panel-3); border-color: var(--mavi); box-shadow: 0 0 0 1px var(--mavi); color: #fff; }
.kd-form.free { flex-direction: row; gap: 14px; width: 100%; padding: 10px 14px; text-align: left; }
.kd-form.free small { display: block; margin-top: 5px; font: 400 13px/1.35 var(--font); color: var(--muted); }
.kd-mini { flex: none; width: 46px; height: auto; }
.kd-mini .f { fill: #173f2a; stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.kd-mini .l { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 1; }
.kd-mini .d { fill: #fff; }
.kd-mini .g { fill: var(--gold); }
.kd-mini.lg { width: 74px; }
.kd-mini.lg .d { stroke: rgba(255, 255, 255, .6); stroke-width: .7; }
.kd-quick-karma { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 18px; padding: 12px 14px; background: linear-gradient(100deg, var(--bordo-ink), var(--panel-2) 62%); border: 1px solid var(--bordo-2); border-radius: 10px; color: var(--text); text-align: left; }
.kd-quick-karma b { display: block; font: 800 24px/1 var(--display); font-style: italic; text-transform: uppercase; }
.kd-quick-karma small { display: block; margin-top: 5px; font-size: 13px; line-height: 1.35; color: var(--text-2); }
.kd-quick-karma > svg.i { margin-left: auto; color: var(--muted); }
.kd-quick-karma:hover { border-color: var(--bordo-3); }
.kd-quick-art { flex: none; display: flex; }
.kd-quick-clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.kd-quick-club { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); font: 600 14px/1.15 var(--font); text-align: left; }
.kd-quick-club span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-quick-club:hover { border-color: var(--mavi); color: #fff; }
.kd-quick-club.home { background: linear-gradient(100deg, rgba(125, 29, 63, .38), var(--ink-2)); border-color: var(--bordo-2); color: #fff; }
.kd-share .kd-note { margin: 0; }
.kd-share-link { display: flex; gap: 8px; margin: 14px 0; }
.kd-share-link .input { min-width: 0; font: 500 13.5px/1 var(--mono); }
.kd-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kd-png-stage { display: flex; justify-content: center; margin-bottom: 14px; }
.kd-png-stage .skeleton { width: 100%; max-width: 360px; }
.kd-png-canvas { width: 100%; max-width: 360px; height: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.kd-png .kd-share-row { justify-content: center; }
@media (max-width: 480px) { .kd-share-link { flex-direction: column; } .kd-share-row .btn { flex: 1 1 auto; } .kd-quick-clubs { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ paylaşılmış kadro (salt okunur) */
.kd-view-side { position: static; height: auto; min-height: 0; max-height: none; gap: 18px; padding: 16px; }
/* telefonda asıl düğme sahanın üstünde durur; geniş ekranda yan paneldeki yeterli */
.kd-view-top { display: none; gap: 8px; margin-bottom: 12px; }
.kd-view-top .btn-cut { flex: 1; }
@media (max-width: 980px) { .kd-view-top { display: flex; } }
.kd-view-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kd-view-row .btn { flex: 1 1 auto; }
.kd-vl ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.kd-vl li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 40px 18px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 14.5px; }
.kd-vl-no { font: 700 15px/1 var(--display); color: var(--muted); text-align: right; }
.kd-vl-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ son paylaşılanlar */
.kd-recent { padding: 34px 0 6px; }
.kd-recent-head h2 { margin-top: 8px; font-size: clamp(24px, 2.6vw, 34px); font-style: italic; }
.kd-recent-head h2 em { font-style: italic; color: var(--bordo-3); }
.kd-recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; margin-top: 16px; }
.kd-rc { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 10px 14px 10px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); transition: transform .15s, border-color .15s; }
.kd-rc:hover { transform: translateY(-2px); border-color: var(--bordo-2); color: #fff; }
.kd-rc-t { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.kd-rc-t b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font: 800 18px/1.05 var(--display); font-style: italic; text-transform: uppercase; overflow-wrap: anywhere; }
.kd-rc-t small { font: 600 12px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--mavi); }
.kd-rc-t i { font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (prefers-reduced-motion: reduce) {
  .kd-tok.empty.sel .kd-plus, .kd-tok.mv .kd-kit, .kd-chip.mv .kd-kit { animation: none; }
  .kd-kit, .kd-plus, .kd-rc, .kd-trash { transition: none; }
}

/* ---------------------------------------------------------------- taktik çizimi */
.kd-draw, .kd-draw-ui { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.kd-draw { z-index: 1; }
.kd-draw-ui { z-index: 4; }
.kd-pitch.tac { touch-action: none; cursor: crosshair; }
.kd-pitch.tac.tool-sel { cursor: default; }
.kd-pitch.tac .kd-tok { pointer-events: none; }
.kd-pitch.tac .kd-tok.empty { opacity: .4; }
.kd-h { fill: #fff; stroke: #0b0d12; stroke-width: 2.6; }
.kd-h.mid { fill: var(--gold); }
.kd-h.soft { fill-opacity: .5; }
.kd-h-ring { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-dasharray: 6 4; }
.kd-tac { display: grid; gap: 10px; margin-bottom: 12px; padding: 10px; background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--gold); border-radius: var(--radius); }
.kd-tac[hidden] { display: none; }
.kd-tac-tools { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.kd-tac-tools::-webkit-scrollbar { display: none; }
.kd-tool { flex: 1 0 auto; display: inline-flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; padding: 9px 8px 8px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; color: var(--text-2); font: 700 11.5px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transition: border-color .15s, color .15s; }
.kd-tool svg { width: 20px; height: 20px; }
.kd-tool:hover { border-color: var(--line-2); color: #fff; }
.kd-tool.active { background: rgba(232, 182, 76, .13); border-color: var(--gold); color: var(--gold-2); }
.kd-tac-opts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.kd-lines-pick { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.kd-lines-pick button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; background: var(--ink-2); border: 0; border-right: 1px solid var(--line); color: var(--text-2); font: 600 12.5px/1 var(--font); white-space: nowrap; }
.kd-lines-pick button:last-child { border-right: 0; }
.kd-lines-pick svg { width: 36px; height: 12px; flex: none; }
.kd-lines-pick button:hover:not(:disabled) { color: #fff; }
.kd-lines-pick button.active { background: rgba(95, 182, 232, .15); color: #fff; }
.kd-lines-pick button:disabled, .kd-dcolors button:disabled { opacity: .35; cursor: default; }
.kd-dcolors { display: inline-flex; gap: 7px; }
.kd-dcolors button { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid rgba(255, 255, 255, .28); }
.kd-dcolors button.active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--gold); }
.kd-tac-end { display: inline-flex; gap: 2px; margin-left: auto; }
@media (max-width: 560px) {
  .kd-tac { padding: 8px; }
  .kd-tac-tools { gap: 5px; }
  .kd-tool { flex: 1 1 0; min-width: 0; padding: 8px 2px 7px; font-size: 10px; letter-spacing: .02em; }
  .kd-lines-pick button { padding: 0 9px; }
  .kd-lines-pick button span, .kd-tac-end .btn span { display: none; }
  .kd-tac-end .btn { padding: 0 9px; }
}

/* ------------------------------------------------------------------ rakip takım (karşılıklı düzen)
   Rakip eklenince saha tam boya çıkar (68/105), bizim takım alt yarıya iner, rakip üst yarıya ters dizilir.
   Sahada 22 oyuncu durduğu için pullar küçülür; ölçüler pages/kadro.js içindeki ghostSizes() ile aynıdır. */
.kd-pitch.duo { aspect-ratio: 68 / 105; }
/* geniş ekranda tahta biraz daralır: tam boy saha ekrana olabildiğince sığsın, pullar da okunur kalsın */
@media (min-width: 981px) { .kd-stage.duo { max-width: min(640px, max(520px, calc((100vh - 240px) * .6476))); } }
.kd-pitch.duo .kd-tok { --tok: 38px; --tokw: 84px; --tokf: 11.5px; }
@media (max-width: 560px) { .kd-pitch.duo .kd-tok { --tok: 26px; --tokw: 50px; --tokf: 9px; } }
@supports (width: 1cqw) {
  .kd-board .kd-pitch.duo .kd-tok { --tok: clamp(25px, 6.6cqw, 42px); --tokw: clamp(46px, 14.5cqw, 92px); --tokf: clamp(8.6px, 1.88cqw, 12px); }
}
.kd-pitch.duo .kd-tok-in { gap: 1px; }
.kd-pitch.duo .kd-name { padding: 2px 7px; }
/* iki takım bir bakışta ayrılsın: bizim plakanın altı mavi, rakibinki beyaz */
.kd-tok.opp .kd-name { box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .85); }
/* dar tahtada hatlar birbirine yakındır: mevki, yaş, ülke satırı alttaki oyuncunun formasına binmesin */
@container (max-width: 520px) { .kd-pitch.duo .kd-meta { display: none; } }

.kd-opp { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 6px 5px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.kd-opp[hidden] { display: none; }
.kd-opp-k { flex: none; font: 700 11px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.kd-opp-form { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 7px 0 10px; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); transition: border-color .15s; }
.kd-opp-form b, b.kd-opp-form { font: 800 16px/1 var(--display); font-style: italic; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.kd-opp-form svg { width: 13px; height: 13px; color: var(--muted); }
button.kd-opp-form:hover { border-color: var(--mavi); }
b.kd-opp-form.static { padding: 0 10px; }
.kd-opp .kd-in { flex: 1; }
.kd-opp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/1.25 var(--font); color: var(--text); }
.kd-opp .btn { flex: none; }
.kd-opp.static { padding-right: 14px; }
@container (max-width: 460px) { .kd-opp { gap: 8px; padding-left: 10px; } .kd-opp [data-act="quick"] span { display: none; } }

.kd-side-pick[hidden] { display: none; }
.kd-side-pick button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-used.opp { color: var(--text-2); }
.kd-opt h5.kd-opt-sub { margin-top: 14px; }
