/* Kente: a loom of sliding rows */
.kt-col { gap: 6px; padding: 4px 6px; }
.kt-head { min-height: 26px; font-size: 14px; }
.kt-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; direction: ltr; }
.kt-wrap.is-wide { flex-direction: row; gap: 22px; }
.kt-goal { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kt-cap { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mist); }
.kt-cloth { direction: ltr; display: flex; flex-direction: column; gap: var(--gap, 2px); }
.kt-target {
  --gap: 1px;
  padding: 4px;
  border-radius: 6px;
  background: #17110D;
  box-shadow: 0 0 0 2px rgba(242, 160, 61, 0.55), 0 6px 16px rgba(0, 0, 0, 0.4);
}
.kt-target .kt-line { display: flex; }
.kt-loom {
  --gap: 4px;
  position: relative;
  display: flex; flex-direction: column; gap: var(--gap);
  padding: 8px 20px;
  border-radius: 12px;
  background: linear-gradient(90deg, #6B4226 0 12px, #1C1009 12px calc(100% - 12px), #6B4226 calc(100% - 12px));
  box-shadow: 0 0 0 2px rgba(242, 160, 61, 0.4), 0 10px 26px rgba(0, 0, 0, 0.5);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.kt-row {
  position: relative;
  width: calc(var(--cs) * var(--n));
  height: var(--cs);
  overflow: hidden;
  border-radius: 4px;
  cursor: grab;
  touch-action: none;
  outline: 0 solid #FBEFD9;
}
.kt-row.is-sel { outline-width: 3px; z-index: 2; }
.kt-strip { display: flex; width: calc(var(--cs) * (var(--n) + 2)); height: 100%; will-change: transform; }
.kt-c {
  position: relative;
  flex: none;
  width: var(--cs); height: var(--cs);
  box-shadow: inset 0 0 0 1px rgba(23, 17, 13, 0.55);
}
.kt-c::after {
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 4px);
}
.kt-target .kt-c::after { display: none; }
.kt-t0 { background: linear-gradient(#17110D, #17110D) 0 26% / 100% 9% no-repeat, linear-gradient(#17110D, #17110D) 0 74% / 100% 9% no-repeat, #F2B632; }
.kt-t1 { background: linear-gradient(90deg, transparent 20%, #F2B632 20% 34%, transparent 34% 66%, #F2B632 66% 80%, transparent 80%), #1E8A4C; }
.kt-t2 { background: linear-gradient(#17110D, #17110D) center / 26% 26% no-repeat, linear-gradient(#F2B632, #F2B632) center / 52% 52% no-repeat, #C8281E; }
.kt-t3 { background: linear-gradient(135deg, transparent 40%, #F2B632 40% 60%, transparent 60%), linear-gradient(45deg, transparent 40%, #F2B632 40% 60%, transparent 60%), #17110D; }
.kt-t4 { background: conic-gradient(#FBEFD9 25%, transparent 0 50%, #FBEFD9 0 75%, transparent 0) center / 50% 50%, #1F5FA8; }
/* a knot ties a row to the one below it */
.kt-knot {
  position: absolute; left: 4px;
  width: 12px;
  border: 3px solid #FBEFD9; border-right: 0;
  border-radius: 8px 0 0 8px;
  pointer-events: none;
}
.kt-knot::before {
  content: "";
  position: absolute; left: -6px; top: 50%;
  width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%;
  background: #F28C28;
  box-shadow: 0 0 0 2px #1C1009;
}
.kt-knot--r { left: auto; right: 4px; border: 3px solid #FBEFD9; border-left: 0; border-radius: 0 8px 8px 0; }
.kt-knot--r::before { left: auto; right: -6px; }
.kt-row.is-ok { box-shadow: 0 0 0 2px #F2B632; }
.kt-row.is-done { animation: kt-flash 0.5s ease-out both; }
@keyframes kt-flash { 0% { filter: brightness(1); } 40% { filter: brightness(1.7); transform: scaleX(1.03); } 100% { filter: brightness(1); } }
@media (prefers-reduced-motion: reduce) { .kt-row.is-done { animation: none; } }
