/* Artificial intelligence lesson. All rules scoped under .ain-* */
.ain-sc { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* the five animals */
.ain-grid { width: 100%; max-width: 340px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ain-card { position: relative; width: calc(33.3% - 6px); display: flex; flex-direction: column; align-items: center; padding: 6px 4px 4px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s, opacity .1s; }
.ain-card img { width: 72%; aspect-ratio: 1; object-fit: contain; }
.ain-name { font: 600 12px/1.15 var(--sans); color: var(--dim); text-align: center; min-height: 28px; display: flex; align-items: center; }
.ain-stamp { font: 800 13px var(--sans); letter-spacing: .04em; padding: 2px 8px; border-radius: 7px; color: var(--dim); background: var(--raised); }
.ain-card.stamped.yes .ain-stamp { background: var(--gold); color: #1A2136; }
.ain-card.stamped.ok { box-shadow: inset 0 0 0 2px var(--mint); }
.ain-card.stamped.bad { box-shadow: inset 0 0 0 2px var(--red); }
.ain-card.thump { animation: ainThump .3s ease-out; }
@keyframes ainThump { 0% { transform: scale(1.08); } 100% { transform: scale(1); } }
.ain-card.flick { opacity: .55; }
.ain-card[data-tap] { cursor: pointer; }
.ain-card.picked { box-shadow: inset 0 0 0 3px var(--violet-bright); }
.ain-card.picked.bad { box-shadow: inset 0 0 0 3px var(--red); }
.ain-card.picked.ok { box-shadow: inset 0 0 0 3px var(--mint); }
.ain-rules { font: 500 14px var(--sans); color: var(--dim); }
.ain-rules b { color: var(--text); background: var(--violet-deep); padding: 2px 8px; border-radius: 8px; }
.ain-capt { font: 500 12px var(--sans); color: var(--dim); }
.ain-tally { font: 500 15px var(--sans); color: var(--dim); }
.ain-tally b { color: var(--text); }

/* rule chips */
.ain-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-bottom: 8px; }
.ain-chip { min-height: 44px; border-radius: 14px; border: 0; font: 700 15px var(--sans); color: var(--dim); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); cursor: pointer; }
.ain-chip.on { color: #1A2136; background: var(--violet-bright); box-shadow: none; }

/* the rulebook: a programmer, and the pile of rules beside her */
.ain-book { position: relative; width: 100%; max-width: 330px; height: 250px; display: flex; align-items: flex-end; }
.ain-coder { width: 54%; align-self: flex-end; }
.ain-pile { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 8px; }
.ain-stack { width: 46px; height: 4%; border-radius: 4px 4px 2px 2px; background: repeating-linear-gradient(to top, #EAE3D7 0 3px, #b9b2a6 3px 4px); box-shadow: 0 0 0 2px var(--violet-deep); }
.ain-count { display: flex; flex-direction: column; padding-bottom: 2px; }
.ain-count b { font: 700 22px var(--serif); color: var(--gold); line-height: 1; }
.ain-count span { font: 500 14px var(--sans); color: var(--dim); }
.ain-count i { font: 700 15px var(--sans); color: var(--text); font-style: normal; margin-top: 6px; }

/* the photo counter */
.ain-meter { display: flex; align-items: baseline; gap: 8px; }
.ain-meter b { font: 700 22px var(--serif); color: var(--gold); min-width: 110px; text-align: right; }
.ain-meter span { font: 500 14px var(--sans); color: var(--dim); }

/* the map app, then Shakey */
.ain-map { position: relative; margin: 0; width: 100%; max-width: 300px; height: 240px; }
.ain-map img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-height: 100%; transition: opacity .5s; }
.ain-phone { width: 46%; }
.ain-shakey { height: 100%; border-radius: 12px; opacity: 0; }
.ain-map.then .ain-phone { opacity: 0; }
.ain-map.then .ain-shakey { opacity: 1; }

@media (max-height: 700px) {
  .ain-grid { max-width: 300px; gap: 6px; }
  .ain-card img { width: 62%; }
  .ain-name { min-height: 26px; }
  .ain-book { height: 200px; }
  .ain-map { height: 190px; }
}
