/* Killer Sudoku — ink on parchment, cages in dashed gold. */

[hidden] { display: none !important; }

.ks-frame {
  width: min(620px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(10px, 2.2vw, 18px);
}
.deal-line {
  margin: 0;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(14px, 2.1vw, 16.5px);
  color: var(--ink-soft);
  min-height: 1.4em;
}
.deal-line b { color: var(--oxblood); font-weight: 600; }

/* ---- the grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  aspect-ratio: 1;
  width: 100%;
  background: linear-gradient(180deg, var(--cream), #efe3c2);
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(58, 48, 36, .75), 0 3px 10px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.cell {
  position: relative;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--display);
  font-size: clamp(17px, 3.4vw, 28px);
  color: var(--oxblood);
  cursor: pointer;
  border-right: 1px solid rgba(122, 104, 80, .3);
  border-bottom: 1px solid rgba(122, 104, 80, .3);
}
.cell.bx-r { border-right: 2px solid rgba(58, 48, 36, .75); }
.cell.bx-b { border-bottom: 2px solid rgba(58, 48, 36, .75); }
.cell.given { color: var(--ink); font-weight: 600; }
.cell.sel { background: rgba(227, 183, 84, .32); }
.cell.kin { background: rgba(227, 183, 84, .16); }
.cell.sel.kin { background: rgba(227, 183, 84, .32); }
.cell.bad { color: var(--oxblood-bright); background: rgba(158, 43, 37, .14); }
.cell.hint-flash { animation: ks-hint 1s ease 2; }
@keyframes ks-hint {
  0%, 100% { background: none; }
  50% { background: rgba(122, 176, 132, .4); }
}

/* cage walls: dashed lines inset within the cells */
.cell::after {
  content: '';
  position: absolute;
  inset: 2px;
  pointer-events: none;
  border: 0 dashed rgba(122, 104, 80, .75);
}
.cell.cg-t::after { border-top-width: 1.5px; }
.cell.cg-r::after { border-right-width: 1.5px; }
.cell.cg-b::after { border-bottom-width: 1.5px; }
.cell.cg-l::after { border-left-width: 1.5px; }

.cage-sum {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: var(--caps);
  font-size: clamp(8.5px, 1.5vw, 11px);
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(58, 48, 36, .8);
  line-height: 1;
  pointer-events: none;
}

.marks {
  position: absolute;
  inset: 12% 6% 6% 6%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}
.marks span {
  font-family: var(--display);
  font-size: clamp(8px, 1.6vw, 11.5px);
  color: rgba(94, 27, 32, .75);
  display: grid;
  place-items: center;
  line-height: 1;
}

/* ---- the pad ---- */
.pad-row { display: flex; justify-content: center; }
.pad {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  width: 100%;
}
.pad-key {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  border: 1.5px solid rgba(122, 104, 80, .5);
  background: linear-gradient(180deg, var(--cream), #efe3c2);
  font-family: var(--display);
  font-size: clamp(15px, 2.6vw, 22px);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: transform .1s var(--ease);
}
.pad-key:hover { transform: translateY(-2px); }
.pad-key.spent { opacity: .35; }
.pad-key[aria-pressed="true"] { background: var(--oxblood); color: var(--parchment); border-color: var(--oxblood); }

.frame-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.help-body { text-align: left; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.help-body p { margin: 0 0 12px; }
.help-body b { color: var(--oxblood); }

.new-best {
  display: inline-block;
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11.5px;
  color: var(--parchment);
  background: var(--oxblood);
  border-radius: 5px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

@media (max-width: 560px) {
  .pad { grid-template-columns: repeat(6, 1fr); }
  .pad-key { aspect-ratio: 5 / 4; }
}
