/* Fiat Currency lesson. All rules scoped under .fia-* */

/* eleven cents */
.fia-cost { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 16px; }
.fia-bill { position: relative; width: 100%; max-width: 440px; }
.fia-bill img { display: block; width: 100%; border-radius: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.fia-sticker { position: absolute; right: -4px; top: -26px; display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border-radius: 12px; background: var(--raised); border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(252,192,80,.45); rotate: 8deg; opacity: 0; scale: 1.8; transition: opacity .3s, scale .4s cubic-bezier(.2,.8,.2,1.3); }
.fia-sticker span { font: 700 11.5px var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.fia-sticker b { font: 800 30px var(--sans); color: var(--gold); line-height: 1.05; }
.fia-cost.tag .fia-sticker { opacity: 1; scale: 1; }
.fia-bill.sm { max-width: 220px; }

/* the flip */
.fia-flip { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 16px 0; perspective: 900px; }
.fia-card { position: relative; width: 100%; max-width: 400px; aspect-ratio: 2.35; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,.7,.2,1); }
.fia-card:disabled { cursor: default; }
.fia-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fia-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; box-shadow: 0 10px 26px rgba(0,0,0,.45); }
.fia-new { transform: rotateY(180deg); }
.fia-flip.flipped .fia-card { transform: rotateY(180deg); }
.fia-hi { position: absolute; border-radius: 8px; border: 3px solid var(--gold); box-shadow: 0 0 18px rgba(252,192,80,.6); opacity: 0; transition: opacity .4s; }
.fia-hi-old { left: 33%; top: 47%; width: 44%; height: 27%; opacity: 1; }
.fia-hi-new { left: 55.5%; top: 25%; width: 25%; height: 15%; }
.fia-flip.hi .fia-hi-new { opacity: 1; }
.fia-cap { font: 700 13px var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }

/* cutting the card */
.fia-cut { display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.fia-sold { height: 190px; width: auto; filter: drop-shadow(0 8px 16px rgba(123,92,253,.3)); }
.fia-deck { position: relative; width: 156px; aspect-ratio: 0.7; }
.fia-pc { position: absolute; inset: 0; transition: translate .5s cubic-bezier(.2,.8,.2,1.3), rotate .5s, scale .5s; }
.fia-pc img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fia-cut.cut .fia-pc0 { translate: -16px -14px; rotate: -6deg; }
.fia-cut.cut .fia-pc1 { translate: 16px -14px; rotate: 5deg; }
.fia-cut.cut .fia-pc2 { translate: -16px 14px; rotate: 4deg; }
.fia-cut.cut .fia-pc3 { translate: 16px 14px; rotate: -5deg; }
.fia-sig { position: absolute; width: 28%; height: auto; fill: none; stroke: #0b1033; stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset .6s ease-out; }
.fia-pc0 .fia-sig { left: 13%; top: 24%; }
.fia-pc1 .fia-sig { left: 59%; top: 24%; }
.fia-pc2 .fia-sig { left: 13%; top: 72%; }
.fia-pc3 .fia-sig { left: 59%; top: 72%; }
.fia-cut.signed .fia-sig { stroke-dashoffset: 0; }
.fia-cut.signed .fia-pc1 .fia-sig { transition-delay: .22s; }
.fia-cut.signed .fia-pc2 .fia-sig { transition-delay: .44s; }
.fia-cut.signed .fia-pc3 .fia-sig { transition-delay: .66s; }
.fia-cut.paid .fia-deck { filter: drop-shadow(0 0 16px rgba(252,192,80,.55)); }

/* the town */
.fia-town { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fia-row { display: flex; justify-content: center; gap: 4px; width: 100%; }
.fia-p { flex: 1 1 0; max-width: 96px; display: flex; flex-direction: column; align-items: center; padding: 0 0 4px; border: 2px solid transparent; border-radius: 14px; background: transparent; color: var(--text); font-family: var(--sans); cursor: pointer; transition: filter .4s; }
.fia-slot { height: 56px; display: flex; align-items: flex-end; justify-content: center; }
.fia-who { height: 116px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(123,92,253,.25)); }
.fia-p b { font: 800 13px var(--sans); margin-top: 2px; }
.fia-got { min-height: 17px; font: 600 12.5px var(--sans); color: var(--mint); }
.fia-tok { width: 36px; height: auto; border-radius: 4px; rotate: -8deg; box-shadow: 0 0 14px rgba(252,192,80,.6); transition: filter .4s, opacity .3s, scale .3s; }
.fia-tok.fia-wait { opacity: 0; scale: .4; }
.fia-tok.dead { filter: grayscale(1) brightness(.6); box-shadow: none; }
.fia-town.dead .fia-p:not(:first-child) .fia-who { filter: grayscale(.7) brightness(.75); }
.fia-no { padding: 3px 10px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line-strong); font: 800 13px var(--sans); color: var(--dim); }
.fia-bought { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fia-bought > span { font: 700 12px var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.fia-chips { display: flex; gap: 6px; min-height: 34px; }
.fia-chip { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 2px solid var(--gold); font: 800 14px var(--sans); color: var(--text); animation: fiaPop .35s cubic-bezier(.2,.8,.2,1.5); }
@keyframes fiaPop { from { scale: .4; opacity: 0; } }

/* taxes */
.fia-tax { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0; }
.fia-gov { width: 180px; filter: drop-shadow(0 10px 20px rgba(123,92,253,.3)); }

@media (max-height: 700px) {
  .fia-sold { height: 150px; }
  .fia-deck { width: 128px; }
  .fia-who { height: 92px; }
  .fia-slot { height: 52px; }
  .fia-gov { width: 140px; }
  .fia-bill.sm { max-width: 180px; }
  .fia-card { max-width: 330px; }
}
