/* Kakuro: ink on washi paper, origami clue triangles, a vermilion seal */
.kk-col { gap: 6px; padding: 6px 8px; }
.kk-side { display: contents; }
.kk-sizes { order: -1; }
.kk-status { min-height: 22px; margin: 0; font-size: 14px; text-align: center; }
.kk-status.is-bad { color: #FF9C8A; }
.kk-board {
  --n: 6;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  grid-template-rows: repeat(var(--n), 1fr);
  gap: 2px;
  direction: ltr;
  width: 280px; height: 280px;
  padding: 4px;
  border-radius: 12px;
  background: #161026;
  box-shadow: 0 0 0 2px rgba(246, 166, 193, 0.5), 0 10px 28px rgba(0, 0, 0, 0.45);
  font-size: 28px;
  -webkit-user-select: none; user-select: none;
}
.kk-blk { position: relative; min-width: 0; min-height: 0; border-radius: 3px; background: #1D1631; }
.kk-blk svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; }
.kk-face { fill: #2E3A7C; }
.kk-fold { fill: #FBF3EA; opacity: 0.13; }
.kk-tri text { fill: #FBF3EA; font: 800 13.5px var(--font-display); }
.kk-tri.is-on .kk-face { fill: #7A4E9E; }
.kk-tri.is-on text { fill: #FFFFFF; }
.kk-tri.is-ok text { fill: #B9DB8A; }
.kk-tri.is-bad .kk-face { fill: #E0452F; }
.kk-tri.is-bad text { fill: #FFFFFF; }
.kk-cell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 0;
  margin: 0; padding: 0;
  border: 0; border-radius: 3px;
  background: #FBF3EA;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(217, 178, 95, 0.14));
  color: #161026;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.kk-cell.is-peer { background: #FBE3EA; background-image: none; }
.kk-cell.is-sel { background: #F6A6C1; background-image: none; box-shadow: inset 0 0 0 2px #E0452F; }
.kk-cell:focus-visible { outline: 3px solid #D9B25F; outline-offset: -3px; z-index: 2; }
.kk-v {
  font: 800 1em/1 var(--font-display);
  transform: rotate(var(--tilt, 0deg));
  text-shadow: 0.02em 0.03em 0 rgba(22, 16, 38, 0.35);
  animation: kk-ink 0.22s ease-out;
}
.kk-cell.is-bad .kk-v { color: #D2321C; }
.kk-cell.is-bad { box-shadow: inset 0 0 0 2px rgba(224, 69, 47, 0.75); }
.kk-notes {
  position: absolute; top: 6%; right: 6%; bottom: 6%; left: 6%;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  direction: ltr;
}
.kk-notes i { display: flex; align-items: center; justify-content: center; font: 700 0.36em/1 var(--font-body, sans-serif); color: #2E3A7C; }
.kk-cell.is-won { animation: kk-glow 0.9s ease-out; }
.kk-seal {
  position: absolute; right: 5%; bottom: 5%;
  width: 27%; height: 27%;
  opacity: 0; pointer-events: none;
  transform: rotate(-9deg) scale(2.4);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}
.kk-seal svg { width: 100%; height: 100%; display: block; }
.kk-board.is-sealed .kk-seal { opacity: 0.94; transform: rotate(-9deg) scale(1); transition: transform 0.28s cubic-bezier(0.5, 0, 0.6, 1.5), opacity 0.14s; }
.kk-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; max-width: 420px; direction: ltr; }
.kk-key {
  height: 44px; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline); border-radius: 10px;
  background: var(--lapis-raise); color: var(--parchment);
  font: 800 22px/1 var(--font-display);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.kk-key:active { background: var(--gold); color: var(--lapis); transform: translateY(1px); }
.kk-key svg { width: 22px; height: 22px; }
.kk-key--x { color: var(--gold); }
@keyframes kk-ink { from { transform: rotate(var(--tilt, 0deg)) scale(1.5); opacity: 0.2; } }
@keyframes kk-glow { 40% { background-color: #FBD3E0; } }
@media (min-height: 760px) { .kk-key { height: 50px; } .kk-col { gap: 10px; } }
@media (max-height: 600px) and (orientation: portrait) { .kk-key { height: 40px; } .kk-col { gap: 4px; padding-top: 4px; padding-bottom: 4px; } }
@media (orientation: landscape) and (max-height: 520px) {
  .kk-col { flex-direction: row; gap: 16px; }
  .kk-col .kit-board-wrap { width: auto; flex: 1 1 0; height: 100%; }
  .kk-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; flex: 0 0 290px; }
  .kk-sizes { order: 0; }
  .kk-key { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .kk-v, .kk-cell.is-won { animation: none; }
  .kk-board.is-sealed .kk-seal { transition: none; }
}
