/* Elephant Parade — a sign with the rule, a muddle of elephant buttons, and the parade along the ground. */

body[data-game="elephants"] .fa-stage { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 6px 8px 0; overflow: hidden; -webkit-user-select: none; user-select: none; }

.ep-sign { flex: none; align-self: center; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 14px; margin: 2px 0 4px;
  border-radius: 999px; background: var(--lapis-deep); border: 2px solid var(--w-ochre); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.ep-sign.is-pop { animation: ep-pop 0.45s both; }
.ep-sign__pics { display: flex; align-items: flex-end; gap: 6px; direction: ltr; color: var(--w-ochre); }
.ep-sign__el { display: block; width: 46px; height: 38px; }
.ep-sign__el.is-s { width: 26px; height: 22px; }
.ep-sign__el svg { display: block; width: 100%; height: 100%; }
.ep-sign__arrow { width: 24px; height: 24px; align-self: center; }
.ep-sign__num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; align-self: center;
  font: 800 1rem/1 system-ui, sans-serif; color: var(--w-cream); text-shadow: 0 1px 0 #2B1A10, 0 0 3px #2B1A10; border: 2px solid var(--w-cream); }
.ep-sign__cap { font-size: 0.82rem; font-weight: 700; color: var(--parchment); white-space: nowrap; }

.ep-muddle { position: relative; flex: 1; align-self: stretch; min-height: 0; direction: ltr; }
.ep-cell { position: absolute; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; border-radius: 18px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ep-cell:focus-visible { outline: 3px solid var(--w-cream); outline-offset: -3px; }
.ep-el { position: absolute; display: block; animation: ep-in 0.35s backwards; transition: transform 0.12s; }
.ep-el svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 0 rgba(28, 16, 9, 0.35)); }
.ep-cell:active .ep-el { transform: scale(0.94); }
.ep-el.is-no { animation: ep-no 0.4s; }
.ep-cell.is-hint .ep-el { animation: ep-hint 0.9s ease-in-out infinite; }
.ep-cell.is-gone { visibility: hidden; pointer-events: none; }
.ep-cell.is-wander .ep-el { transition: transform 0.9s ease-in, opacity 0.9s; transform: translateY(18px) scale(0.85); opacity: 0.35; }

/* The ground: a savanna strip with a bold zigzag border; the parade walks along it, front at the right. */
.ep-ground { flex: none; align-self: stretch; position: relative; height: clamp(58px, 17vh, 130px); margin: 0 -8px; padding: 0 8px 6px;
  background: linear-gradient(180deg, #6E8F4F, #5A773F 60%, #4A6334); direction: ltr; }
.ep-ground::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 10px;
  background: linear-gradient(135deg, #6E8F4F 25%, transparent 25%) 0 0 / 18px 18px, linear-gradient(225deg, #6E8F4F 25%, transparent 25%) 0 0 / 18px 18px; }
.ep-ground::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--w-clay) 0 12px, var(--w-ochre) 12px 24px, var(--w-earth) 24px 30px); }
.ep-parade { position: absolute; left: 6px; right: 6px; top: 4px; bottom: 10px; display: flex; flex-direction: row-reverse; align-items: flex-end;
  justify-content: flex-start; transition: transform 1s ease-in; }
.ep-parade.is-off { transform: translateX(115%); }
.ep-pe { flex: none; position: relative; display: block; width: calc(var(--pu) * 1.2 * var(--s)); height: calc(var(--pu) * var(--s));
  transform-origin: 50% 50%; transition: transform 0.55s cubic-bezier(0.3, 0.9, 0.35, 1.1); }
.ep-pe + .ep-pe { margin-right: calc(var(--pu) * -0.24 * var(--s)); }
.ep-pe svg { display: block; width: 100%; height: 100%; overflow: visible; animation: ep-walk 0.6s ease-in-out infinite alternate; animation-delay: inherit; }

.ep-time { position: relative; flex: 1; max-width: 520px; height: 14px; margin: 0 16px; border-radius: 8px; background: var(--lapis-deep); border: 1px solid var(--hairline); direction: ltr; }
.ep-time__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--w-clay), var(--w-sunset) 55%, var(--w-ochre)); }
.ep-time__sun { position: absolute; top: 50%; left: 100%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FFE3A1, var(--w-ochre) 55%, var(--w-sunset)); box-shadow: 0 0 12px rgba(242, 160, 61, 0.7); }
.ep-time.is-low .ep-time__sun { animation: ep-low 0.6s infinite alternate; }

@keyframes ep-pop { 0% { transform: scale(0.7); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
@keyframes ep-in { from { transform: translateY(14px) scale(0.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ep-no { 0%, 100% { transform: none; } 20% { transform: rotate(-6deg); } 45% { transform: rotate(5deg); } 70% { transform: rotate(-3deg); } }
@keyframes ep-hint { 0%, 100% { transform: none; } 50% { transform: translateY(-8%) rotate(-3deg); } }
@keyframes ep-walk { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-5%) rotate(1.5deg); } }
@keyframes ep-low { to { box-shadow: 0 0 18px 4px rgba(196, 83, 45, 0.9); } }

@media (prefers-reduced-motion: reduce) {
  .ep-sign.is-pop, .ep-el, .ep-el.is-no, .ep-cell.is-hint .ep-el, .ep-pe svg, .ep-time.is-low .ep-time__sun { animation: none; }
  .ep-cell.is-hint .ep-el { outline: 3px dashed var(--w-ochre); outline-offset: 2px; border-radius: 12px; }
  .ep-parade, .ep-pe { transition: none; }
}

@media (max-width: 430px) { body[data-game="elephants"] .fa-title { font-size: 0.8rem; } }
@media (max-width: 360px) {
  body[data-game="elephants"] .fa-bar { gap: 5px; }
  body[data-game="elephants"] .fa-title { font-size: 0.8rem; }
  body[data-game="elephants"] .fa-chip { min-width: 0; padding-left: 8px; padding-right: 8px; }
  .ep-sign__cap { font-size: 0.72rem; }
}
@media (max-height: 600px) {
  body[data-game="elephants"] .kit-start .fa-panel { padding: 14px 18px; }
  body[data-game="elephants"] .kit-start .kit-art { max-width: 104px; border-radius: 12px; }
  body[data-game="elephants"] .kit-start .fa-panel__title { margin: 2px 0 4px; font-size: 1.4rem; }
  body[data-game="elephants"] .kit-start .fa-panel__text { margin-bottom: 10px; font-size: 0.88rem; line-height: 1.35; }
  body[data-game="elephants"] .kit-start .fa-howto { gap: 5px; margin: 0; font-size: 0.88rem; line-height: 1.3; }
}
