.ka{
  --bg:#f8fafc;
  --card: rgba(255,255,255,.96);
  --card2: rgba(255,255,255,.92);
  --text:#111827;
  --muted: rgba(17,24,39,.62);
  --accent:#57a6ff;
  --ok:#16a34a;
  --bad:#dc2626;
  --warn:#d97706;

  --border: rgba(17,24,39,.12);
  --cell: rgba(17,24,39,.06);
  --cell2: rgba(17,24,39,.10);

  --shadow: 0 10px 25px rgba(17,24,39,.10);
  --radius:18px;

  --cell-size: 44px;
  --gap: 6px;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #ffffff, #f3f6ff);
  color: var(--text);
}
.ka, .ka *{box-sizing:border-box}

.ka .app{max-width:1150px; margin:0 auto; padding:14px;}

.ka .top{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:8px 6px;
}

.ka .brand{display:flex; align-items:center; gap:12px;}

.ka .logo{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background: rgba(87,166,255,.14);
  border:1px solid rgba(87,166,255,.35);
  box-shadow: var(--shadow);
  font-weight:900;
}

.ka .titles h1{margin:0; font-size:20px; letter-spacing:.2px}
.ka .sub{margin:2px 0 0; color:var(--muted); font-size:12px}

.ka .hud{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}

.ka .pill{
  display:flex; gap:8px; align-items:center;
  padding:9px 12px; border-radius:999px;
  background: var(--card);
  border:1px solid var(--border);
  box-shadow: var(--shadow);
}
.ka .pill .k{color:var(--muted); font-size:12px}
.ka .pill strong{font-size:14px}

.ka .main{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:14px;
}
/* Mobilde tek kolon: selector mutlaka .ka ile aynı özgüllükte olmalı */
@media (max-width: 980px){
  .ka .main{grid-template-columns:1fr}
}

.ka .board{
  background: var(--card2);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:12px;
  box-shadow: var(--shadow);
  position:relative;
}

.ka .top-words{
  padding:10px 10px;
  border-radius: 16px;
  background: rgba(17,24,39,.03);
  border:1px solid var(--border);
  margin-bottom:10px;
}

.ka .top-words-head{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  margin-bottom:8px;
}

.ka .tw-title{
  font-weight:800;
  letter-spacing:.2px;
  font-size:13px;
  color: var(--text);
}

.ka .tw-counter{
  margin-left:8px;
  font-size:12px;
  font-weight:800;
  color: rgba(17,24,39,.75);
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.04);
}

.ka .tw-actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}
.ka .tw-note{margin-top:8px; color:var(--muted); font-size:12px}

.ka .top-word-chips{ display:flex; gap:8px; flex-wrap:wrap; }

.ka .tw-chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px; border-radius:999px;
  background: #fff;
  border:1px solid var(--border);
  font-size:12px;
}
.ka .tw-chip .tw-text{font-weight:800; letter-spacing:.2px;}

.ka .now{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.ka .now-label{color:var(--muted); font-size:12px}

.ka .now-word{
  padding:8px 12px; border-radius:999px;
  background: #fff;
  border:1px solid var(--border);
  min-height:34px;
  display:flex; align-items:center;
  letter-spacing:.8px;
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ka .grid{
  display:grid;
  gap: var(--gap);
  touch-action: none;
  user-select: none;
  justify-content:center;
  margin: 8px 0 12px;
}

.ka .cell{
  width: var(--cell-size);
  height: var(--cell-size);
  display:flex; align-items:center; justify-content:center;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--cell2), var(--cell));
  border:1px solid var(--border);
  font-weight:900;
  letter-spacing:.6px;
  color: var(--text);
}

.ka .cell.sel{
  outline: 2px solid rgba(87,166,255,.55);
  background: rgba(87,166,255,.18);
}
.ka .cell.found{
  background: rgba(22,163,74,.16);
  outline: 2px solid rgba(22,163,74,.40);
}
.ka .cell.hint{
  background: rgba(217,119,6,.14);
  outline: 2px solid rgba(217,119,6,.35);
}

.ka .board-actions{ display:flex; gap:10px; flex-wrap:wrap; }

.ka .btn{
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:14px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  cursor:pointer;
}
.ka .btn:hover{ outline:1px solid rgba(87,166,255,.22) }
.ka .btn:active{ transform: translateY(1px) }
.ka .btn.ghost{ background: rgba(17,24,39,.03) }
.ka .btn.warn{ background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.25); }
.ka .btn.tiny{ padding:8px 10px; border-radius: 12px; font-size: 12px; }

.ka .toast{
  margin-top: 10px;
  padding:10px 12px;
  border-radius: 14px;
  background: rgba(17,24,39,.06);
  border:1px solid var(--border);
  color: var(--text);
  display:none;
}
.ka .toast.show{display:block;}
.ka .toast.ok{outline:2px solid rgba(22,163,74,.25)}
.ka .toast.bad{outline:2px solid rgba(220,38,38,.22)}
.ka .toast.warn{outline:2px solid rgba(217,119,6,.22)}

.ka .side{display:flex; flex-direction:column; gap:14px}

.ka .card{
  background: var(--card2);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
}

.ka .card h2{margin:0 0 10px 0; font-size:15px; color: rgba(17,24,39,.70)}
.ka .card-head{display:flex; align-items:center; justify-content:space-between; gap:10px}

.ka .toggles{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}

.ka .switch{
  display:flex; gap:8px; align-items:center;
  color: rgba(17,24,39,.70);
  font-size:12px;
  padding:6px 10px; border-radius:999px;
  background: #fff;
  border:1px solid var(--border);
}

.ka .switch input{accent-color: var(--accent); transform: scale(1.05)}
.ka .hint{color:var(--muted); font-size:12px; margin:10px 0 0}

.ka .level-info{ color: rgba(17,24,39,.78); line-height: 1.45; font-size: 13px; }
.ka .level-info .li{
  margin:8px 0;
  padding:10px 12px;
  border-radius: 14px;
  background: #fff;
  border:1px solid var(--border);
}
.ka .level-info b{color:var(--text)}

.ka .foot{margin-top:12px; color:rgba(17,24,39,.55); text-align:center}

@media (max-width: 520px){
  .ka .app{padding:12px}
  .ka .top{flex-direction:column; align-items:flex-start}
  .ka .hud{justify-content:flex-start}
  .ka .logo{width:42px; height:42px}
  .ka .titles h1{font-size:18px}
}

/* Hibrit: kilitli kelimeler */
.ka .tw-chip.locked{
  background: rgba(17,24,39,.03);
  border-color: var(--border);
}
.ka .tw-chip.locked .tw-text{
  color: rgba(17,24,39,.45);
  letter-spacing: 2px;
}

/* Bulunan: üstü çizili + tik (GARANTİ) */
.ka #foundWordChips .tw-chip.done{
  background: rgba(22,163,74,.10);
  border-color: rgba(22,163,74,.25);
}
.ka #foundWordChips .tw-chip.done .tw-text{
  text-decoration: line-through !important;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(17,24,39,.55);
  opacity: .95;
}
.ka #foundWordChips .tw-chip.done::after{
  content:"✓";
  font-weight:900;
  opacity:.95;
}
