/* The task board: three dark columns on a black page, cards with a coloured edge for their part of the house. */
:root {
  --page: #000000;          /* the page */
  --column: #0e0e11;
  --column-edge: #1f1f25;
  --card: #18181d;
  --card-edge: #2a2a31;
  --ink: #f2f1ee;
  --muted: #8b8a91;
  --done: #8fdc9b;          /* the tick of a card done */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Epilogue Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.board {
  display: grid;
  user-select: none;
  -webkit-user-select: none;
  grid-template-columns: repeat(3, minmax(0, 260px));
  align-items: start;
  gap: 14px;
  width: min(820px, 100%);
  justify-content: center;
}

/* ---------------------------------------------------------------- a column */
.col {
  padding: 14px 12px 12px;
  border-radius: 20px;
  background: var(--column);
  box-shadow: inset 0 0 0 1px var(--column-edge);
  transition: background-color 0.25s, box-shadow 0.25s;
}

/* the column a card is over while it is carried */
.col.is-over {
  background: #15151a;
  box-shadow: inset 0 0 0 1px #3a3a44;
}

.col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 12px;
}

.col__name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

/* the count rolls when it changes */
.col__count {
  display: inline-grid;
  overflow: hidden;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: #24242b;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.col__count > span {
  grid-area: 1 / 1;
}

.col__cards {
  display: grid;
  gap: 8px;
  min-height: 64px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------------------------------------------------------------- a card */
.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--card-edge);
  cursor: grab;
  outline: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* the coloured edge: which part of the house */
.card::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: var(--area);
}

.card__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.3s;
}

.card__area {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.card.is-done .card__title {
  color: var(--muted);
}

.card__check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--done);
  transform: scale(0);
}

.card__check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #10240f;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card:focus-visible {
  box-shadow: inset 0 0 0 1px var(--card-edge), 0 0 0 2px var(--page), 0 0 0 4px var(--ink);
}

html[data-using='pointer'] .card:focus-visible {
  box-shadow: inset 0 0 0 1px var(--card-edge);
}

/* carried: above everything, on the layer */
.card.is-carried {
  cursor: grabbing;
  box-shadow: inset 0 0 0 1px #3d3d46, 0 22px 40px -12px rgba(0, 0, 0, 0.9);
}

/* lifted with the keys: in its column, standing out */
.card.is-lifted {
  box-shadow: inset 0 0 0 1.5px var(--ink), 0 14px 30px -12px rgba(0, 0, 0, 0.9);
}

/* the gap where the card will land */
.slot {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px #34343c;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px);
}

.layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.board.is-dragging,
.board.is-dragging .card {
  cursor: grabbing;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .board {
    grid-template-columns: minmax(0, 1fr);
    width: min(420px, 100%);
  }
}
