/* Anagram: painted wooden letter blocks on a toy-stall shelf (Bazaar world). */
.an-col { justify-content: center; gap: 10px; padding: 0 6px 6px; direction: ltr; }
.an-awning {
  position: absolute; top: 0; left: 0; right: 0; height: 26px; pointer-events: none;
  background:
    radial-gradient(circle at 16px 12px, #D81B78 0 11.5px, transparent 12px) 0 6px / 64px 26px repeat-x,
    radial-gradient(circle at 48px 12px, #FF9933 0 11.5px, transparent 12px) 0 6px / 64px 26px repeat-x,
    repeating-linear-gradient(90deg, #D81B78 0 32px, #FF9933 32px 64px) 0 0 / auto 18px no-repeat;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}
.an-beads { display: flex; gap: 7px; align-items: center; margin-top: 30px; }
.an-bead { width: 13px; height: 13px; border-radius: 50%; background: rgba(255, 244, 224, 0.16); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); transition: background 0.3s, transform 0.3s; }
.an-bead.is-now { background: var(--w-cream); transform: scale(1.25); }
.an-bead.is-s { background: var(--w-leaf); }
.an-bead.is-h { background: var(--w-turmeric); }
.an-bead.is-x { background: #7A3A4C; }
.an-shelf {
  padding: 10px 10px 0; border-bottom: 10px solid #A8713C; border-radius: 6px 6px 8px 8px;
  background: linear-gradient(rgba(38, 8, 19, 0), rgba(38, 8, 19, 0.55));
  box-shadow: 0 5px 0 #6E4421, 0 12px 14px rgba(0, 0, 0, 0.35);
}
.an-slots, .an-tray { display: flex; justify-content: center; direction: ltr; }
.an-slots { gap: 4px; padding-bottom: 6px; }
.an-slot {
  width: var(--an-s, 44px); height: var(--an-sh, 44px); flex: none; border-radius: 9px; font-size: calc(var(--an-s, 44px) * 0.58);
  border: 2px dashed rgba(255, 213, 146, 0.42); background: rgba(38, 8, 19, 0.45);
}
.an-tray { flex-wrap: wrap; gap: 9px; width: var(--an-tw, 280px); max-width: 100%; }
.an-hole {
  width: var(--an-t, 60px); height: var(--an-t, 60px); flex: none; border-radius: 12px; font-size: calc(var(--an-t, 60px) * 0.56);
  background: rgba(38, 8, 19, 0.35); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}
.an-tile {
  display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transform-origin: 0 0; transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15); position: relative; z-index: 1;
}
.an-slot .an-tile { margin: -2px; width: calc(100% + 4px); height: calc(100% + 4px); }
.an-face {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  border-radius: 22%; font-family: var(--font-display); line-height: 1; text-transform: uppercase;
  color: var(--w-cream); text-shadow: 0 0.06em 0 rgba(38, 8, 19, 0.4);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%), var(--an-paint, #D81B78);
  box-shadow: 0 4px 0 #A8713C, 0 5px 0 #6E4421, 0 8px 9px rgba(0, 0, 0, 0.38);
  transition: transform 0.2s, filter 0.2s;
}
.an-face::before { content: ""; position: absolute; top: 9%; right: 9%; bottom: 9%; left: 9%; border-radius: 18%; border: 2px solid rgba(255, 244, 224, 0.5); }
.an-hole .an-face { transform: rotate(var(--an-r, 0deg)); }
.an-tile:active .an-face { transform: translateY(3px); box-shadow: 0 1px 0 #A8713C, 0 2px 0 #6E4421, 0 3px 5px rgba(0, 0, 0, 0.38); }
.an-tile:focus-visible { outline: 2px solid var(--w-cream); outline-offset: 3px; border-radius: 12px; }
.an-c0 { --an-paint: #D81B78; }
.an-c1 { --an-paint: #1FA2A6; }
.an-c2 { --an-paint: #FF9933; }
.an-c3 { --an-paint: #3F9B4B; }
.an-c4 { --an-paint: #F4C430; }
.an-c2 .an-face, .an-c4 .an-face { color: #3A0E1E; text-shadow: none; }
.an-c2 .an-face::before, .an-c4 .an-face::before { border-color: rgba(58, 14, 30, 0.4); }
.an-tile.is-lock .an-face::after { content: ""; position: absolute; top: -5px; right: -5px; width: 13px; height: 13px; border-radius: 50%; background: var(--w-cream); border: 3px solid #3A0E1E; }
.an-slots.is-bad { animation: an-shake 0.36s; }
.an-tile.is-ok .an-face { animation: an-hop 0.5s both; animation-delay: calc(var(--an-i, 0) * 60ms); }
.an-tile.is-shown .an-face { filter: saturate(0.45) brightness(0.85); }
#sub { min-height: 30px; text-align: center; }
@keyframes an-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 45% { transform: translateX(8px); } 70% { transform: translateX(-5px); } 88% { transform: translateX(3px); } }
@keyframes an-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-16px) rotate(-5deg); } 70% { transform: translateY(2px); } }
@media (max-height: 600px) { .an-col { gap: 6px; } .an-beads { margin-top: 26px; } }
@media (max-height: 430px) { .an-awning { display: none; } .an-beads { margin-top: 0; } .an-shelf { padding-top: 4px; } }
@media (prefers-reduced-motion: reduce) { .an-tile, .an-face { transition: none; } .an-slots.is-bad, .an-tile.is-ok .an-face { animation: none; } }
html[dir="rtl"] #sub { direction: rtl; }
