/* Achi — bottle caps on a carved wooden board. The board art is inline SVG; caps and points are DOM. */
.ac-defs { position: absolute; }
.ac-col { padding: 4px 10px 8px; gap: 8px; }
.ac-status { min-height: 30px; font-size: 0.97rem; line-height: 1.2; }
.ac-wrap { direction: ltr; }
.ac-board { position: relative; flex: none; width: 280px; height: 280px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ac-art { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)); }
.ac-caps, .ac-pts { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ac-caps { pointer-events: none; }

/* the nine points: big invisible buttons, with a ring where a tap will do something */
.ac-pt { position: absolute; width: 29%; height: 29%; margin: -14.5% 0 0 -14.5%; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ac-pt::after { content: ""; position: absolute; top: 18%; right: 18%; bottom: 18%; left: 18%; border-radius: 50%; border: 3px dashed transparent; }
.ac-pt.is-go::after { top: 21%; right: 21%; bottom: 21%; left: 21%; border: 3px solid var(--gold-soft); box-shadow: 0 0 12px rgba(248, 201, 135, 0.7); animation: ac-pulse 1.3s ease-in-out infinite; }
.ac-pt.is-go.is-cap::after { top: 3%; right: 3%; bottom: 3%; left: 3%; border-width: 4px; border-color: var(--w-cream); }
.ac-pt.is-hole::after { border-color: var(--w-cream); opacity: 0.85; animation: ac-pulse 1.3s ease-in-out infinite; }
.ac-pt:focus-visible { outline: 3px solid var(--w-cream); outline-offset: -4px; }
.ac-pt.is-no { animation: ac-no 0.3s linear; }

/* a bottle cap */
.ac-cap { position: absolute; width: 25%; height: 25%; border-radius: 50%; transform: translate(-50%, -50%); transition: left 0.3s cubic-bezier(0.3, 0.8, 0.3, 1), top 0.3s cubic-bezier(0.3, 0.8, 0.3, 1), opacity 0.3s linear; box-shadow: 0 5px 7px rgba(0, 0, 0, 0.5); }
.ac-cap svg { display: block; width: 100%; height: 100%; }
.ac-cap.is-drop svg { animation: ac-drop 0.32s cubic-bezier(0.3, 1.5, 0.5, 1); }
.ac-cap.is-no svg { animation: ac-no 0.3s linear; }
.ac-board.is-over .ac-cap { opacity: 0.5; }
.ac-board.is-over .ac-cap.is-win { opacity: 1; z-index: 2; }
.ac-cap.is-win svg { animation: ac-win 0.55s ease-in-out 2; }
@keyframes ac-drop { from { transform: scale(1.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ac-no { 25% { transform: translateX(-7%); } 75% { transform: translateX(7%); } }
@keyframes ac-win { 50% { transform: scale(1.22) rotate(14deg); } }
@keyframes ac-pulse { 50% { transform: scale(0.9); opacity: 0.55; } }

/* the two hands: whose turn it is and how many caps are still to place */
.ac-tray { flex: none; display: flex; align-items: center; gap: 9px; width: 100%; max-width: 420px; min-height: 44px; padding: 5px 12px; border-radius: 16px; border: 2px solid transparent; background: rgba(28, 16, 9, 0.5); opacity: 0.6; transition: opacity 0.2s linear, border-color 0.2s linear; }
.ac-tray.is-turn { opacity: 1; border-color: var(--gold); background: rgba(242, 160, 61, 0.14); }
.ac-tray__cap { flex: none; width: 30px; height: 30px; }
.ac-tray__name { flex: 1 1 auto; min-width: 0; font-weight: 700; color: var(--parchment); text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-tray__left { flex: none; display: flex; gap: 5px; direction: ltr; }
.ac-slot { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px dashed rgba(217, 194, 163, 0.35); }
.ac-slot.is-full { border-color: transparent; }
.ac-slot svg { display: block; width: 100%; height: 100%; }

/* the new-game panel */
.ac-opts { display: grid; gap: 12px; text-align: start; }
.ac-opt { transition: opacity 0.2s linear; }
.ac-opt.is-off { opacity: 0.35; pointer-events: none; }
.ac-opt__label { margin: 0 0 5px; font-size: 12px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); }
html[lang="ar"] .ac-opt__label { letter-spacing: 0; font-size: 13px; }
.ac-opts .fa-seg { display: flex; width: 100%; border-radius: 16px; }
.ac-opts .fa-seg button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 6px; border-radius: 13px; line-height: 1.15; }

@media (max-height: 600px) {
  .ac-col { gap: 5px; padding-top: 2px; }
  .ac-tray { min-height: 36px; padding: 2px 10px; }
  .ac-slot { width: 22px; height: 22px; }
  .ac-status { min-height: 24px; font-size: 0.9rem; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .ac-tray { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-cap { transition: none; }
  .ac-pt.is-go::after, .ac-pt.is-hole::after, .ac-cap.is-win svg, .ac-cap.is-drop svg { animation: none; }
}
