.board-row-mask {
  overflow: hidden;
  width: 100%;
  padding: 32px 0;
  margin: -32px 0;
  mask-image: linear-gradient(to right, transparent 0, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 8%, black 92%, transparent 100%);
  touch-action: pan-y;
  cursor: grab;
}

.board-row-mask.board-row-mask--static {
  mask-image: none;
  -webkit-mask-image: none;
}

.board-row-mask.is-dragging {
  cursor: grabbing;
}

.board-row {
  display: flex;
  will-change: transform;
  gap: 24px;
  align-items: stretch;
  position: relative;
  width: max-content;
}

.board-row .scatter-card {
  flex: 0 0 auto;
  width: max-content;
  min-width: 220px;
  max-width: 360px;
}

@supports not (width: max-content) {
  .board-row .scatter-card {
    width: auto;
    min-width: 220px;
    max-width: 360px;
  }
}

.board-row .scatter-card.is-clone {
  pointer-events: auto;
}

.board-row .scatter-card .card-title {
  padding-right: 48px;
}

.embedded-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.embedded-board .card-span-2x1 {
  grid-column: span 2;
}

.embedded-board .card-span-1x2 {
  grid-row: span 2;
}

.embedded-board .card-span-2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.scatter-card {
  --scatter-rotate: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: var(--border-radius-lg);
  border: 2.5px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-primary);
  text-decoration: none;
  height: 100%;
  opacity: 0;
  transform: translateY(50px) rotate(var(--scatter-rotate));
  transition: transform 0.5s ease, opacity 0.5s ease, border var(--transition-base);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.scatter-card:visited,
.scatter-card:hover,
.scatter-card:focus-visible {
  text-decoration: none;
}

.embedded-board .scatter-card,
.embedded-board .scatter-card:visited,
.embedded-board .scatter-card:hover,
.embedded-board .scatter-card:focus-visible {
  text-decoration: none !important;
  opacity: 1;
  transform: rotate(var(--scatter-rotate));
}

.scatter-card.slide-from-left {
  transform: translateX(-18vw) translateY(50px) rotate(var(--scatter-rotate));
}

.scatter-card.slide-from-right {
  transform: translateX(18vw) translateY(50px) rotate(var(--scatter-rotate));
}

.scatter-card.in-view {
  opacity: 1;
  transform: translateY(0) rotate(var(--scatter-rotate));
}

.scatter-card:hover,
.scatter-card:focus-visible {
  animation: cardWiggle 0.48s ease forwards;
  outline: none;
}

.scatter-card .card-title {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  padding-right: 56px;
  text-decoration: none;
}

.scatter-card .card-meta {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.scatter-card .card-subtitle {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 500;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.scatter-card .card-thumbnail {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border-soft);
  background: var(--color-fill-soft);
}

.scatter-card .card-thumbnail img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.card-tag {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: var(--color-fill-hover);
}

.card-lock-icon {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 24px;
  height: 24px;
  pointer-events: none;
  color: var(--color-text-secondary);
}

.scatter-card[data-locked] .card-icon {
  display: none;
}

.card-icon {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 28px;
  height: 28px;
  pointer-events: none;
  color: var(--color-text-primary);
}

.card-icon use {
  pointer-events: none;
}

.tilt-left {
  --scatter-rotate: -1.4deg;
}

.tilt-right {
  --scatter-rotate: 1.4deg;
}

.tilt-soft-left {
  --scatter-rotate: -0.9deg;
}

.tilt-soft-right {
  --scatter-rotate: 0.9deg;
}

.tilt-straight {
  --scatter-rotate: 0deg;
}

.card-span-2x1 {
  grid-column: span 2;
}

.card-span-1x2 {
  grid-row: span 2;
}

.card-span-2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.scatter-card.is-hidden {
  display: none;
}

@keyframes cardWiggle {
  0% {
    transform: translateY(0) rotate(var(--scatter-rotate));
  }
  25% {
    transform: translateY(-3px) rotate(calc(var(--scatter-rotate) + 1deg));
  }
  55% {
    transform: translateY(2px) rotate(calc(var(--scatter-rotate) - 0.9deg));
  }
  80% {
    transform: translateY(-1px) rotate(calc(var(--scatter-rotate) + 0.6deg));
  }
  100% {
    transform: translateY(0) rotate(var(--scatter-rotate));
  }
}

@media (max-width: 1080px) {
  .board-row {
    gap: 20px;
  }

  .embedded-board {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .board-row {
    gap: 18px;
  }

  .board-row .scatter-card {
    min-width: 190px;
    max-width: 300px;
    border-radius: var(--border-radius-md);
  }

  .board-row .scatter-card .card-title {
    font-size: 1.35rem;
  }

  .board-row .scatter-card .card-subtitle {
    font-size: 0.9rem;
  }

  .board-row .card-tag {
    font-size: 0.72rem;
  }

  .embedded-board {
    grid-template-columns: 1fr;
    gap: 22px;
    justify-items: center;
  }

  .embedded-board .scatter-card {
    width: 100%;
    max-width: 340px;
    padding: 20px;
    border-width: 2px;
    border-radius: var(--border-radius-md);
    margin: 0 auto;
  }

  .embedded-board .card-span-2x1,
  .embedded-board .card-span-1x2,
  .embedded-board .card-span-2x2 {
    grid-column: auto;
    grid-row: auto;
  }

  .embedded-board .scatter-card .card-title {
    font-size: 1.25rem;
  }

  .embedded-board .scatter-card .card-subtitle {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .embedded-board .card-tag {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }
}
