/* Köysipeli: vain .hdp-koysipeli-luokat ja .hdpeli[data-game="koysipeli"]-valitsimet (pelit/README.md). */
.hdp-koysipeli-wrap {
  --hdp-ko-side: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.hdp-koysipeli-cap {
  width: var(--hdp-ko-side);
  max-width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1.2;
  color: var(--hdp-muted, #5b6770);
  overflow: hidden;
}
.hdp-koysipeli-goal {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.hdp-koysipeli-knots {
  flex: none;
  font-weight: 600;
  color: #9a6a1c;
  white-space: nowrap;
}
.hdp-koysipeli-board {
  position: relative;
  width: var(--hdp-ko-side);
  height: var(--hdp-ko-side);
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #173d33;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 14px rgba(23, 61, 51, 0.18);
}
.hdp-koysipeli-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
@media (max-width: 559px) {
  .hdp-koysipeli-board { border-radius: 0; }
  .hdp-koysipeli-cap { padding: 0 12px; }
}

/* Tasovalitsin dialogissa */
.hdp-koysipeli-levels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 2px;
  margin: 4px 0 0;
}
.hdp-koysipeli-lvl {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 48px;
  padding: 4px 2px;
  border: 1px solid #d9dee2;
  border-radius: 8px;
  background: #fff;
  color: #1f2a26;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.hdp-koysipeli-lvl:hover:not(:disabled) { border-color: var(--hdp-primary, #1684b8); }
.hdp-koysipeli-lvl:focus-visible { outline: 2px solid var(--hdp-primary, #1684b8); outline-offset: 1px; }
.hdp-koysipeli-lvl.is-done { background: #f4f8f6; }
.hdp-koysipeli-lvl.is-current { border-color: var(--hdp-primary, #1684b8); box-shadow: inset 0 0 0 1px var(--hdp-primary, #1684b8); }
.hdp-koysipeli-lvl:disabled { cursor: default; color: #a3abb1; background: #f3f4f5; }
.hdp-koysipeli-lvl-s {
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1;
  color: #c29b54;
  min-height: 10px;
}

/* Voittodialogin tähdet */
.hdp-koysipeli-win { margin: 0 0 6px; text-align: center; }
.hdp-koysipeli-stars { display: inline-flex; gap: 6px; font-size: 34px; line-height: 1; }
.hdp-koysipeli-star { color: #d9dee2; }
.hdp-koysipeli-star.is-on { color: #e2b33c; text-shadow: 0 1px 0 #b56219; }
