/* Fog of War card back (pixel art pack). Made by tools/make-backs-tiles.py; replaces the look of .face.back only (the coin fronts are untouched).
   Plain fallback: the whole back.png stretched, pixelated. Where the browser has round(), the back is built from a 9-slice frame, a tiled fill and a centred crest
   at a whole number of screen pixels per art pixel (--s), so the picture stays crisp on every board size (card 30 to 150 px). */
#grid .tile .face.back{
  --s:2px;
  background:#1c1410 url(back.png) 0 0/100% 100% no-repeat;image-rendering:pixelated;
  border:0;border-radius:2px;box-shadow:0 4px 7px rgba(0,0,0,.55)}
#grid .tile .face.back svg{display:none}
@supports (width:round(down,10px,1px)){
  #grid .tile .face.back{
    --s:max(1px,round(down,calc(var(--t,60px) / 30),1px));
    background:url(back-tile.png) 50% 50%/calc(var(--s) * 16) calc(var(--s) * 16) repeat;
    border-radius:calc(var(--s) * 1.5);box-shadow:0 calc(var(--s) * 1.5) calc(var(--s) * 3) rgba(0,0,0,.55)}
  #grid .tile .face.back::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;box-sizing:border-box;
    border:calc(var(--s) * 4) solid transparent;border-image:url(back-frame.png) 4 / 1 / 0 round;image-rendering:pixelated}
  #grid .tile .face.back::after{content:"";position:absolute;inset:0;margin:auto;z-index:2;pointer-events:none;
    --e:max(1px,round(down,calc(var(--t,60px) * .7 / 32),1px));
    width:calc(var(--e) * 32);height:calc(var(--e) * 32);background:url(back-emblem.png) 0 0/100% 100% no-repeat;image-rendering:pixelated}
  /* gentle shimmer: the old svg element becomes a sheen layer; one slow sweep every few seconds, staggered per card */
  #grid .tile .face.back svg{display:block;position:absolute;inset:var(--s);z-index:3;width:calc(100% - var(--s) * 2);height:calc(100% - var(--s) * 2);opacity:1;pointer-events:none;
    background:linear-gradient(115deg,transparent 0 44%,rgba(255,236,170,.30) 50%,transparent 56% 100%) 100% 0/300% 100% no-repeat;
    animation:fbsheen 7s ease-in-out infinite}
  #grid .tile .face.back svg *{display:none}
  #grid .tile:nth-child(3n+1) .face.back svg{animation-delay:-2.4s}
  #grid .tile:nth-child(3n+2) .face.back svg{animation-delay:-4.7s;animation-duration:8.3s}
  @keyframes fbsheen{0%,62%{background-position:100% 0}100%{background-position:0% 0}}
  @media (prefers-reduced-motion:reduce){#grid .tile .face.back svg{animation:none}}
}
