/* The stamp stays in the row label, clear of tile faces and drag targets. */
.table-seal {
  display: inline-block;
  vertical-align: baseline;
  margin-inline-start: .25em;
  padding: 1px 2px;
  border: 1px solid #f0c894;
  border-radius: 3px 2px 3px 2px;
  background: #83382d;
  color: #fff1ce;
  box-shadow: inset 0 0 0 1px #a35a45;
  font: 700 10px/1 'Kaiti TC', 'STKaiti', 'DFKai-SB', var(--serif);
  letter-spacing: .02em;
  transform: rotate(-3deg);
  pointer-events: none;
}
.narrow-row .table-seal { margin-inline: 0 .2em; }
.groups.compact-faces .meld-label:has(.table-seal)::before { content: none; }
.groups.compact-faces .table-seal {
  display: block;
  width: 9px;
  margin: 0 auto;
  padding: 1px 0;
  font-size: 7px;
  line-height: 1;
  white-space: normal;
  word-break: break-all;
  transform: none;
}
.table-seal-fall { animation: table-seal-settle 180ms var(--table-stamp-delay) ease-out both; }
@keyframes table-seal-settle {
  from { opacity: 0; }
  to { opacity: 1; }
}
.table-seal-stage, .table-travel-layer, .table-travel-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.table-seal-stage {
  z-index: 9;
  overflow: hidden;
  border-radius: inherit;
}
.table-large-seal, .table-ink-dragon-flight {
  position: absolute;
  inset: 0 auto auto 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.table-large-seal {
  display: grid;
  place-content: center;
  letter-spacing: .04em;
  color: #ffedc2;
  background: repeating-linear-gradient(16deg, #aa482900 0 3px, #82342038 3.5px 4px), #a03929;
  border: 2px solid #f0cb8d;
  outline: 1px solid #72291c;
  box-shadow: inset 0 0 0 3px #943726, inset 0 0 0 4px #efc594, 0 4px 9px #261c168c;
  border-radius: 11% 6% 9% 5%;
  font-family: 'Kaiti TC', 'STKaiti', 'BiauKai', 'DFKai-SB', var(--serif);
  font-weight: 900;
  line-height: 1;
  animation: table-seal-press 620ms cubic-bezier(.16,.78,.29,1) both;
}
@keyframes table-seal-press {
  0% { opacity: 0; transform: translate(var(--press-x), var(--press-y)) translate(-50%,-68%) scale(1.7) rotate(-17deg); }
  19% { opacity: 1; transform: translate(var(--press-x), var(--press-y)) translate(-50%,-50%) scale(.90) rotate(-6deg); }
  34%, 51% { opacity: 1; transform: translate(var(--press-x), var(--press-y)) translate(-50%,-50%) scale(1) rotate(-7deg); }
  84%, 100% { opacity: 0; transform: translate(var(--landing-x), var(--landing-y)) translate(-50%,-50%) scale(.17) rotate(-3deg); }
}
.table-ink-dragon-flight {
  aspect-ratio: 3;
  background: url('assets/ink-dragon.webp') center / contain no-repeat;
  filter: drop-shadow(0 2px 2px #13261ce6) drop-shadow(0 0 3px #ffd986);
  animation: table-dragon-sweep 735ms cubic-bezier(.28,.59,.43,.95) both;
}
@keyframes table-dragon-sweep {
  0% { opacity: 0; transform: translate(var(--origin-x), var(--origin-y)) translate(-50%,-50%) scale(.14) rotate(5deg); }
  16% { opacity: .93; transform: translate(var(--entry-x), var(--entry-y)) translate(-50%,-50%) scale(.68) rotate(-10deg); }
  46% { opacity: 1; transform: translate(var(--mid-x), var(--mid-y)) translate(-50%,-50%) scale(1) rotate(-4deg); }
  66% { opacity: 1; transform: translate(var(--exit-x), var(--exit-y)) translate(-50%,-50%) scale(.9) rotate(6deg); }
  94%, 100% { opacity: 0; transform: translate(var(--landing-x), var(--landing-y)) translate(-50%,-50%) scale(.09) rotate(12deg); }
}
[data-table-art] .groups, .meld-tiles:has(> .table-ink-row-hit) { position: relative; }
.table-ink {
  position: absolute;
  display: block;
  z-index: 2;
  pointer-events: none;
}
.table-ink-cut-left, .table-ink-cut-right, .table-ink-vacated {
  top: 10%;
  bottom: 2%;
  width: 45%;
  filter: drop-shadow(0 0 2px #ffcf76);
  animation: table-ink-cut 760ms ease-out both;
}
.table-ink-cut-left { left: -1px; }
.table-ink-cut-right { right: -1px; }
.table-ink-vacated { height: 24px; bottom: auto; }
.table-ink-cut-left::before, .table-ink-cut-right::before, .table-ink-vacated::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, #fff1b6, #d7a35a 45%, #733821 62%, #eedbab);
  clip-path: polygon(58% 0%, 42% 33%, 69% 29%, 37% 69%, 57% 65%, 29% 100%, 37% 75%, 20% 80%, 46% 43%, 26% 47%);
}
@keyframes table-ink-cut { 0%, 35% { opacity: 1; } 100% { opacity: 0; } }
.table-travel-layer {
  position: fixed;
  z-index: 9299;
  overflow: hidden;
  contain: strict;
}
.table-travel-line { width: 100%; height: 100%; }
.table-travel-line path {
  fill: none;
  stroke: #e8c684;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  filter: drop-shadow(0 0 2px #2c5948);
  animation: table-draw-line 590ms ease-out both;
}
@keyframes table-draw-line {
  from { stroke-dashoffset: 1; opacity: .15; }
  63% { stroke-dashoffset: 0; opacity: .98; }
  to { stroke-dashoffset: 0; opacity: 0; }
}
.table-travel-tile {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 1px;
  border: 1px solid #fff0c7;
  border-radius: 4px;
  background: linear-gradient(135deg, #fffbed, #eddaad);
  box-shadow: 0 2px 0 #92794a, 0 3px 7px #193825b3;
  color: #383b2a;
  font: 700 11px/1 var(--serif);
  offset-anchor: center;
  offset-rotate: 0deg;
  animation: table-travel 400ms cubic-bezier(.24,.72,.36,1) both;
}
@keyframes table-travel {
  0%, 9% { offset-distance: 0%; }
  to { offset-distance: 100%; }
}
.table-pending-arrival { opacity: 0; }
.table-ink-join, .table-ink-dragon {
  inset-inline: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 99px;
  transform-origin: left;
}
.table-ink-join {
  background: #d1fada;
  box-shadow: 0 0 4px #5a966d;
  animation: table-ink-line 420ms 300ms ease-out both;
}
@keyframes table-ink-line {
  0% { opacity: 0; transform: scaleX(.15); }
  30%, 65% { opacity: 1; transform: scaleX(1); }
  to { opacity: 0; transform: scaleX(1); }
}
.table-ink-dragon {
  height: 15%;
  min-height: 3px;
  background: linear-gradient(to top, #e5a429, #fff5af 37%, #fff7c369);
  box-shadow: 0 0 7px #ffd769;
  animation: table-nine-lights 880ms calc(var(--charge-delay) + var(--ink-order) * 39ms) ease-out both;
}
@keyframes table-nine-lights {
  0% { opacity: 0; transform: scaleX(.2); }
  13%, 65% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}
.table-ink-row-hit {
  inset: -2px;
  border-inline: 2px solid #e4d09b;
  border-radius: 5px;
  box-shadow: 0 1px #f2e3a7;
  animation: table-row-impact 420ms 370ms ease-out both;
}
@keyframes table-row-impact {
  from { opacity: 0; transform: scale(.96, 1.04); }
  24% { opacity: 1; transform: scale(1, .94); }
  48% { opacity: .85; transform: scale(1.025, 1.025); }
  to { opacity: 0; transform: none; }
}
.meld-tiles:has(> .table-ink-row-hit) > .tile > .tile-face {
  animation: table-face-tap 230ms 370ms ease-out;
}
@keyframes table-face-tap {
  34% { transform: translateY(1.5px) scale(.98); }
  68% { transform: translateY(-.8px); }
}
.table-ink-finish {
  inset: -1px;
  border: 2px solid #ffe693;
  border-radius: inherit;
  box-shadow: inset 0 0 3px #ffe5a0, 0 0 5px #f0bc5e;
  animation: table-ink-finish 440ms 280ms ease-out both;
}
@keyframes table-ink-finish {
  0%, 100% { opacity: 0; }
  22%, 72% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .table-seal-stage, .table-travel-line, .table-travel-tile { display: none; }
  .table-seal-fall, .table-ink, .meld-tiles:has(> .table-ink-row-hit) > .tile > .tile-face { animation: none; }
  .table-ink-dragon, .table-ink-join { height: 2px; box-shadow: none; }
  .table-pending-arrival { opacity: 1; }
}
