/* Adinkra: stamped cloth in earth, clay and cream */
.ad-col { gap: 4px; padding: 6px 10px; }
.ad-head { min-height: 28px; color: var(--w-ochre); font-weight: 750; letter-spacing: 0.01em; }
.ad-sub { min-height: 28px; font-size: 0.95rem; }
.ad-frame {
  position: relative;
  width: 280px; height: 280px;
  padding: 12px;
  border-radius: 10px;
  /* a bold woven border: clay and ochre triangles on dark earth */
  background:
    linear-gradient(135deg, #C4532D 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(225deg, #C4532D 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(315deg, #E8B04A 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, #E8B04A 25%, transparent 25%) 0 0 / 16px 16px,
    #1C1009;
  box-shadow: 0 0 0 2px #1C1009, 0 0 0 4px rgba(232, 176, 74, 0.7), 0 12px 30px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.4s ease;
}
.ad-frame.is-done { box-shadow: 0 0 0 2px #1C1009, 0 0 0 5px #F2A03D, 0 0 34px rgba(242, 160, 61, 0.7); }
.ad-board {
  --n: 3;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  grid-template-rows: repeat(var(--n), 1fr);
  gap: calc(14px - var(--n) * 2px);
  direction: ltr;
  width: 100%; height: 100%;
  padding: calc(14px - var(--n) * 2px);
  border-radius: 6px;
  background: #1C1009;
  -webkit-user-select: none; user-select: none;
}
.ad-cell {
  position: relative;
  min-width: 0; min-height: 0;
  margin: 0; padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ad-cell:focus-visible { outline: 3px solid #FBEFD9; outline-offset: 2px; border-radius: 12%; z-index: 3; }
.ad-cell.is-spin { z-index: 2; }
.ad-tile {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: block;
  border-radius: 12%;
  background: #B8472A;
  background-image: repeating-linear-gradient(90deg, rgba(28, 16, 9, 0.09) 0 1px, transparent 1px 4px), repeating-linear-gradient(0deg, rgba(28, 16, 9, 0.09) 0 1px, transparent 1px 4px);
  color: #2A1509;
  box-shadow: inset 0 0 0 2px rgba(28, 16, 9, 0.3);
  transition: transform 0.32s cubic-bezier(0.3, 1.4, 0.5, 1), background-color 0.3s ease;
  will-change: transform;
}
/* the notch that shows which way is up */
.ad-tile::before {
  content: '';
  position: absolute;
  top: 5%; left: 50%;
  width: 0; height: 0;
  border-left: 0.42em solid transparent;
  border-right: 0.42em solid transparent;
  border-bottom: 0.5em solid currentColor;
  margin-left: -0.42em;
  opacity: 0.85;
}
.ad-tile svg { position: absolute; top: 19%; left: 16%; width: 68%; height: 68%; }
.ad-cell.is-up .ad-tile { background-color: #FBEFD9; color: #2B1A10; }
.ad-cell.is-up .ad-tile::before { border-bottom-color: #7BA05B; opacity: 1; }
.ad-cell.is-hint .ad-tile { box-shadow: 0 0 0 3px #FBEFD9, 0 0 18px 6px rgba(242, 160, 61, 0.9); animation: ad-hint 0.9s ease-in-out infinite; }
.ad-cell.is-hint { z-index: 3; }
.ad-cell.is-done { animation: ad-done 0.6s ease var(--d, 0s) both; }
.ad-cell.is-done .ad-tile { background-color: #F8C987; }
@keyframes ad-hint { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
@keyframes ad-done { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .ad-tile { transition: none; }
  .ad-cell.is-done, .ad-cell.is-hint .ad-tile { animation: none; }
}
