/* looks/frame.css: the signature look + animation of EVERY frame item, one block per item, keyed by .it-<item id>
 * (shop.js adds it-<id> to every rendered item: Shop/Library cards, the preview, in-match names/tiles/podium).
 * Each item must look unlike every other item. Respect prefers-reduced-motion (calmer or no animation there).
 *
 * How it works: ::before is the frame RING (a masked ring, --fr-w thick, over the edge of the video), ::after holds
 * the ornament (rivets, bubbles, flames, drips...). Only the pseudo-elements animate (never the tile or the video),
 * so it stays cheap during a call. Reaction effects that need ::after (fx-burn, fx-beam...) take it over while they
 * run, and reaction/troll animations on the tile itself keep working. */

/* only the 17 base frames; pack frames (items with "pack") are styled in looks/packs.css */
@property --fr-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- shared base ---------- */
.tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff) { animation: none; }               /* drop style.css's old box-shadow pulses on the tile */
@media (prefers-reduced-motion: no-preference) {           /* ...but let reactions/trolls still move the tile */
  .tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff).fx-shake { animation: tileShake 0.12s linear 7; }
  .tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff).fx-siren { animation: sirenFlash 0.4s steps(1) 6; }
  .tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff).troll-spin { animation: spin360 .6s linear 3; }
}
.tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff).fx-goat { box-shadow: 0 0 0 4px #ffd34d, 0 0 40px 8px rgba(255, 200, 40, .8); border-color: #ffd34d; }

.tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff)::before {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  padding: var(--fr-w, 5px); background: none; filter: none; transform: none; animation: none; box-sizing: border-box;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff):not([class*="fx-"])::after {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit; box-sizing: border-box;
}

/* ---------- Bronze: hammered medal metal, four rivets, a slow sheen that glides past now and then ---------- */
.tile.it-fr_bronze { border-color: #6b3d17; box-shadow: 0 3px 0 #3d2009; --fr-w: 7px; }
.tile.it-fr_bronze::before {
  background:
    linear-gradient(115deg, transparent 42%, rgba(255, 226, 180, .85) 50%, transparent 58%) -150% 0 / 250% 100% no-repeat,
    radial-gradient(rgba(60, 25, 5, .35) 1px, transparent 1.6px) 0 0 / 5px 5px,
    radial-gradient(rgba(255, 210, 160, .25) 1px, transparent 1.6px) 2px 3px / 6px 6px,
    linear-gradient(135deg, #e4a36a, #a5622c 35%, #6e3a14 60%, #c27a3f 85%, #7a4419);
  animation: frBronzeSheen 5s ease-in-out infinite;
}
@keyframes frBronzeSheen { 0%, 55% { background-position: -150% 0, 0 0, 2px 3px, 0 0; } 100% { background-position: 250% 0, 0 0, 2px 3px, 0 0; } }
.tile.it-fr_bronze:not([class*="fx-"])::after {
  --rv: radial-gradient(circle at 40% 40%, #fff0dc 0 1px, #e0a06a 1.6px 2.4px, #7a4419 3px, #2a1204 3.4px, transparent 3.8px);
  background: var(--rv) left 0 top 0 / 7px 7px no-repeat, var(--rv) right 0 top 0 / 7px 7px no-repeat,
              var(--rv) left 0 bottom 0 / 7px 7px no-repeat, var(--rv) right 0 bottom 0 / 7px 7px no-repeat;
  box-shadow: inset 0 0 0 7px transparent, inset 0 0 0 8px rgba(40, 18, 4, .55);
}

/* ---------- Silver: polished chrome with one sharp highlight orbiting the frame ---------- */
.tile.it-fr_silver { border-color: #8d97a5; box-shadow: 0 0 12px rgba(214, 221, 232, .3); --fr-w: 5px; }
.tile.it-fr_silver::before {
  background: conic-gradient(from var(--fr-a), #7f8896, #c9d0da 8%, #ffffff 11%, #c9d0da 14%, #7f8896 26%, #dfe4ea 48%,
              #9aa3b0 62%, #eef1f5 80%, #7f8896);
  animation: frOrbit 3.2s linear infinite;
}
.tile.it-fr_silver:not([class*="fx-"])::after { inset: 5px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 11px; }
@keyframes frOrbit { to { --fr-a: 360deg; } }

/* ---------- Gold: baroque gilt frame, double line + curled inner corners, molten gold slowly flowing ---------- */
.tile.it-fr_gold { border-color: #8a5a00; box-shadow: 0 0 20px rgba(255, 211, 77, .45); --fr-w: 8px; }
.tile.it-fr_gold::before {
  background: linear-gradient(135deg, #8a5a00, #ffd34d 18%, #fff3b0 26%, #c8921a 40%, #ffe27a 55%, #9a6a08 70%, #ffd34d 85%, #8a5a00) 0 0 / 220% 220%;
  box-shadow: inset 0 0 0 1.5px #5a3a00;
  animation: frGoldFlow 6s ease-in-out infinite alternate;
}
@keyframes frGoldFlow { to { background-position: 100% 100%; } }
.tile.it-fr_gold:not([class*="fx-"])::after {
  inset: 10px; border: 1.5px solid rgba(255, 211, 77, .85); border-radius: 8px;
  background:
    radial-gradient(circle at 0 0, transparent 6px, #ffd34d 6.5px 8px, transparent 8.5px) left -1px top -1px / 14px 14px no-repeat,
    radial-gradient(circle at 100% 0, transparent 6px, #ffd34d 6.5px 8px, transparent 8.5px) right -1px top -1px / 14px 14px no-repeat,
    radial-gradient(circle at 0 100%, transparent 6px, #ffd34d 6.5px 8px, transparent 8.5px) left -1px bottom -1px / 14px 14px no-repeat,
    radial-gradient(circle at 100% 100%, transparent 6px, #ffd34d 6.5px 8px, transparent 8.5px) right -1px bottom -1px / 14px 14px no-repeat;
  filter: drop-shadow(0 0 2px rgba(90, 58, 0, .8));
}

/* ---------- Diamond: faceted ice-white cut, facets glint in hard steps, two star sparkles twinkle ---------- */
.tile.it-fr_diamond { border-color: #bff4ff; box-shadow: 0 0 22px rgba(127, 227, 255, .55); --fr-w: 6px; }
.tile.it-fr_diamond::before {
  background: repeating-conic-gradient(from var(--fr-a), #f4feff 0 7deg, #7fe3ff 7deg 13deg, #ffffff 13deg 16deg, #3f9fe0 16deg 22deg, #c8f6ff 22deg 30deg);
  animation: frOrbit 6s steps(18) infinite;
}
.tile.it-fr_diamond:not([class*="fx-"])::after {
  --st: linear-gradient(#fff, #fff);
  background:
    var(--st) right 9px top 2px / 2px 14px no-repeat, var(--st) right 3px top 8px / 14px 2px no-repeat,
    radial-gradient(circle, #fff 0 2px, rgba(191, 244, 255, .7) 3px, transparent 6px) right 4px top 3px / 12px 12px no-repeat,
    var(--st) left 9px bottom 2px / 2px 14px no-repeat, var(--st) left 3px bottom 8px / 14px 2px no-repeat,
    radial-gradient(circle, #fff 0 2px, rgba(191, 244, 255, .7) 3px, transparent 6px) left 4px bottom 3px / 12px 12px no-repeat;
  animation: frTwinkle 1.9s ease-in-out infinite;
}
@keyframes frTwinkle { 0%, 100% { opacity: .15; } 45%, 55% { opacity: 1; } }

/* ---------- Neon: two glass tubes (pink outside, cyan inside) that buzz and flicker like a bar sign ---------- */
.tile.it-fr_neon { border-color: #1a0614; box-shadow: none; }
.tile.it-fr_neon::before {
  -webkit-mask: none; mask: none; padding: 0; inset: 5px; border: 3px solid #ffb3e0; border-radius: 12px;
  box-shadow: 0 0 6px #ff2d95, 0 0 14px #ff2d95, inset 0 0 6px #ff2d95;
  animation: frNeonBuzz 3.7s linear infinite;
}
.tile.it-fr_neon:not([class*="fx-"])::after {
  inset: 12px; border: 2px solid #c9fbff; border-radius: 7px;
  box-shadow: 0 0 5px #27e8ff, 0 0 12px #27e8ff, inset 0 0 5px #27e8ff;
  animation: frNeonBuzz 5.3s linear infinite reverse;
}
@keyframes frNeonBuzz { 0%, 18%, 22%, 61%, 63%, 65%, 100% { opacity: 1; } 20%, 62%, 64% { opacity: .25; } }

/* ---------- Doodle: wobbly hand-drawn marker lines that "boil" like a cartoon ---------- */
.tile.it-fr_doodle { border: 3px solid transparent; box-shadow: none; }
.tile.it-fr_doodle::before {
  -webkit-mask: none; mask: none; padding: 0; inset: 3px; border: 3px solid #ffe94d;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  animation: frBoil .5s steps(1) infinite;
}
.tile.it-fr_doodle:not([class*="fx-"])::after {
  inset: 8px; border: 2px dashed #ff8fd0; border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px;
  animation: frBoil .5s steps(1) infinite reverse;
}
@keyframes frBoil {
  0%   { border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; transform: rotate(0); }
  33%  { border-radius: 15px 255px 15px 225px / 225px 15px 255px 15px; transform: rotate(.4deg); }
  66%  { border-radius: 225px 25px 255px 10px / 20px 255px 10px 225px; transform: rotate(-.4deg); }
}

/* ---------- Bubblegum: glossy pink gum frame, bubbles rising up both sides, a gum bubble that blows up and POPS ---------- */
.tile.it-fr_bubble { border: 4px solid #ff5fb4; border-radius: 26px; box-shadow: 0 4px 0 #d13d8f; --fr-w: 5px; }
.tile.it-fr_bubble::before {
  background: linear-gradient(rgba(255, 255, 255, .7), transparent 30%), linear-gradient(135deg, #ffd0ea, #ff8fd0 45%, #ff5fb4);
}
.tile.it-fr_bubble:not([class*="fx-"])::after {
  --bb: radial-gradient(circle at 50% 50%, #fff 0 1.5px, rgba(255, 190, 228, .85) 2.2px 5px, #ff5fb4 5.5px 6px, transparent 6.6px);
  background:
    radial-gradient(circle at 35% 32%, #fff 0 9%, #ffb3dd 15% 58%, #ff5fb4 63% 68%, transparent 71%) left 7px bottom 7px / 0 0 no-repeat,
    var(--bb) left 0 top 0 / 14px 28px repeat-y,
    var(--bb) right 0 top 14px / 14px 34px repeat-y;
  animation: frGum 2.6s linear infinite;
}
@keyframes frGum {
  0%   { background-size: 0 0, 14px 28px, 14px 34px; background-position: left 7px bottom 7px, left 0 top 0, right 0 top 14px; }
  74%  { background-size: 34px 34px, 14px 28px, 14px 34px; }
  75%  { background-size: 0 0, 14px 28px, 14px 34px; }
  100% { background-size: 0 0, 14px 28px, 14px 34px; background-position: left 7px bottom 7px, left 0 top -56px, right 0 top -20px; }
}

/* ---------- Caution Tape: crawling hazard stripes + a CAUTION sign hanging at the top ---------- */
.tile.it-fr_tape { border: 3px solid #111; border-image: none; box-shadow: none; --fr-w: 9px; }
.tile.it-fr_tape::before {
  background: repeating-linear-gradient(45deg, #ffd400 0 10px, #111 10px 20px) 0 0 / 28.284px 28.284px;
  animation: frTapeCrawl 1s linear infinite;
}
@keyframes frTapeCrawl { to { background-position: 28.284px 0; } }
.tile.it-fr_tape:not([class*="fx-"])::after {
  content: "⚠ CAUTION ⚠"; inset: 0 auto auto 50%; transform: translateX(-50%); border-radius: 0 0 5px 5px;
  padding: 1px 8px 2px; background: #ffd400; color: #111; font: 900 10px/1.2 system-ui, sans-serif; letter-spacing: .08em;
  white-space: nowrap; box-shadow: 0 2px 0 #111; transform-origin: 50% 0; animation: frSign 2.4s ease-in-out infinite;
}
@keyframes frSign { 0%, 100% { transform: translateX(-50%) rotate(-2deg); } 50% { transform: translateX(-50%) rotate(2deg); } }
.art-frame.it-fr_tape { --fr-w: 6px; }
.art-frame.it-fr_tape:not([class*="fx-"])::after { font-size: 6px; padding: 0 4px; letter-spacing: 0; }

/* ---------- Inferno: white-hot base, flames licking up both side edges ---------- */
.tile.it-fr_fire { border-color: #c41a00; box-shadow: 0 0 18px rgba(255, 90, 20, .55), 0 -4px 22px rgba(255, 177, 61, .35); --fr-w: 4px; }
.tile.it-fr_fire::before {
  background: linear-gradient(to top, #fff3a0, #ffb13d 15%, #ff6a1a 40%, #c41a00 75%, #4a0a00) 0 0 / 100% 200%;
  animation: frHeat 1.2s ease-in-out infinite alternate;
}
@keyframes frHeat { to { background-position: 0 100%; } }
.tile.it-fr_fire:not([class*="fx-"])::after {
  top: 20%;
  --fl: radial-gradient(ellipse 50% 100% at 50% 100%, #fff3a0 0 18%, #ffb13d 38%, rgba(255, 70, 0, .85) 62%, transparent 72%);
  background: var(--fl) left -3px top 0 / 22px 34px repeat-y, var(--fl) right -3px top 13px / 22px 34px repeat-y,
              var(--fl) left 6px top 7px / 12px 22px repeat-y, var(--fl) right 6px top 3px / 12px 22px repeat-y;
  -webkit-mask: linear-gradient(to top, #000 35%, transparent); mask: linear-gradient(to top, #000 35%, transparent);
  animation: frFlames .7s linear infinite;
}
@keyframes frFlames { to { background-position: left -3px top -34px, right -3px top -21px, left 6px top -37px, right 6px top -41px; } }

/* ---------- Frostbite: icy rim with frost crystals creeping in from every corner ---------- */
.tile.it-fr_ice { border-color: #b8f1ff; box-shadow: 0 0 18px rgba(63, 168, 255, .45); --fr-w: 4px; }
.tile.it-fr_ice::before { background: linear-gradient(135deg, #e9fbff, #9fe6ff 35%, #ffffff 50%, #7fd0ff 65%, #e9fbff); }
.tile.it-fr_ice:not([class*="fx-"])::after {
  background:
    repeating-conic-gradient(from 0deg at 0 0, rgba(255, 255, 255, .85) 0 2deg, rgba(190, 240, 255, .25) 2deg 7deg) left top / 50% 50% no-repeat,
    repeating-conic-gradient(from 270deg at 100% 0, rgba(255, 255, 255, .85) 0 2deg, rgba(190, 240, 255, .25) 2deg 7deg) right top / 50% 50% no-repeat,
    repeating-conic-gradient(from 90deg at 0 100%, rgba(255, 255, 255, .85) 0 2deg, rgba(190, 240, 255, .25) 2deg 7deg) left bottom / 50% 50% no-repeat,
    repeating-conic-gradient(from 180deg at 100% 100%, rgba(255, 255, 255, .85) 0 2deg, rgba(190, 240, 255, .25) 2deg 7deg) right bottom / 50% 50% no-repeat;
  --fm: #000, rgba(0, 0, 0, .55) 35%, transparent 70%;
  -webkit-mask: radial-gradient(circle at 0 0, var(--fm)) left top / 34% 40% no-repeat, radial-gradient(circle at 100% 0, var(--fm)) right top / 34% 40% no-repeat,
                radial-gradient(circle at 0 100%, var(--fm)) left bottom / 34% 40% no-repeat, radial-gradient(circle at 100% 100%, var(--fm)) right bottom / 34% 40% no-repeat;
  mask: radial-gradient(circle at 0 0, var(--fm)) left top / 34% 40% no-repeat, radial-gradient(circle at 100% 0, var(--fm)) right top / 34% 40% no-repeat,
        radial-gradient(circle at 0 100%, var(--fm)) left bottom / 34% 40% no-repeat, radial-gradient(circle at 100% 100%, var(--fm)) right bottom / 34% 40% no-repeat;
  animation: frFrost 4s ease-in-out infinite alternate;
}
@keyframes frFrost { from { opacity: .55; -webkit-mask-size: 24% 28%; mask-size: 24% 28%; } to { opacity: 1; -webkit-mask-size: 38% 46%; mask-size: 38% 46%; } }

/* ---------- Rainbow: five nested color bands, like a rainbow wrapped around the camera, colors cycling ---------- */
.tile.it-fr_rainbow { border-color: #ff3d3d; box-shadow: 0 0 16px rgba(255, 120, 200, .35); }
.tile.it-fr_rainbow::before {
  -webkit-mask: none; mask: none; padding: 0;
  box-shadow: inset 0 0 0 2px #ff8a3d, inset 0 0 0 4px #ffe94d, inset 0 0 0 6px #3dff9a, inset 0 0 0 8px #27e8ff, inset 0 0 0 10px #8a5cff;
  animation: frHue 4s linear infinite;
}
@keyframes frHue { to { filter: hue-rotate(360deg); } }

/* ---------- Disco: mirror-tile rim washed by moving colored lights + a mirror ball swinging at the top ---------- */
.tile.it-fr_disco { border-color: #4a4a6a; box-shadow: 0 0 18px rgba(138, 92, 255, .45); --fr-w: 7px; }
.tile.it-fr_disco::before {
  background:
    linear-gradient(90deg, rgba(255, 45, 149, .65), rgba(39, 232, 255, .65), rgba(255, 233, 77, .6), rgba(138, 92, 255, .65), rgba(255, 45, 149, .65)) 0 0 / 300% 100%,
    conic-gradient(#ffffff 25%, #a9a9c6 0 50%, #ececf6 0 75%, #7d7da0 0) 0 0 / 7px 7px;
  animation: frDiscoLights 2.4s linear infinite;
}
@keyframes frDiscoLights { to { background-position: 150% 0, 0 0; } }
.tile.it-fr_disco:not([class*="fx-"])::after {
  content: "🪩"; inset: -2px auto auto 50%; margin-left: -.5em; font-size: 30px; line-height: 1; transform-origin: 50% -12px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .8)); animation: frBall 1.6s ease-in-out infinite;
}
@keyframes frBall { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
.art-frame.it-fr_disco:not([class*="fx-"])::after { font-size: 13px; }

/* ---------- Glitch: RGB-split rim that tears into slices and jumps around ---------- */
.tile.it-fr_glitch { border-color: rgba(255, 255, 255, .35); box-shadow: none; --fr-w: 4px; }
.tile.it-fr_glitch::before { background: #27e8ff; animation: frGlitchA 1.9s steps(1) infinite; }
.tile.it-fr_glitch:not([class*="fx-"])::after {
  padding: 4px; background: #ff2d95;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: frGlitchB 1.3s steps(1) infinite;
}
@keyframes frGlitchA {
  0%  { transform: none; clip-path: none; }
  8%  { transform: translate(3px, -1px); clip-path: inset(10% 0 55% 0); }
  12% { transform: translate(-2px, 0); clip-path: inset(60% 0 8% 0); }
  16% { transform: none; clip-path: none; }
  70% { transform: translate(-3px, 1px); clip-path: inset(0 0 70% 0); }
  74% { transform: none; clip-path: none; }
}
@keyframes frGlitchB {
  0%  { transform: translate(-2px, 1px); clip-path: none; }
  30% { transform: translate(2px, -1px); clip-path: inset(35% 0 30% 0); }
  36% { transform: translate(-2px, 1px); clip-path: none; }
  80% { transform: translate(4px, 0); clip-path: inset(75% 0 0 0); }
  86% { transform: translate(-2px, 1px); clip-path: none; }
}

/* ---------- Royal: purple velvet studded with gold, gold trim, a crown that floats and glows at the top ---------- */
.tile.it-fr_royal { border-color: #ffd34d; box-shadow: 0 0 18px rgba(177, 140, 255, .5); --fr-w: 8px; }
.tile.it-fr_royal::before {
  background: radial-gradient(circle, #ffe27a 0 1px, transparent 1.6px) 0 0 / 8px 8px,
              radial-gradient(ellipse at 30% 20%, #8a4fd6, #4b1d7a 55%, #2d0a55);
  box-shadow: inset 0 0 0 1.5px #ffd34d;
}
.tile.it-fr_royal:not([class*="fx-"])::after {
  content: "♛"; inset: -1px auto auto 50%; transform: translateX(-50%); font-size: 32px; line-height: 1; color: #ffd34d;
  text-shadow: 0 1px 0 #8a5a00, 0 0 6px rgba(255, 211, 77, .6); animation: frCrown 2.6s ease-in-out infinite;
}
@keyframes frCrown { 0%, 100% { transform: translateX(-50%) translateY(0); opacity: .85; } 50% { transform: translateX(-50%) translateY(2px) scale(1.12); opacity: 1; } }
.art-frame.it-fr_royal { --fr-w: 5px; }
.art-frame.it-fr_royal:not([class*="fx-"])::after { font-size: 12px; }

/* ---------- Biohazard: bubbling radioactive slime rim with goo oozing down from the top ---------- */
.tile.it-fr_toxic { border-color: #1f4d00; box-shadow: 0 0 20px rgba(125, 255, 61, .55); --fr-w: 6px; }
.tile.it-fr_toxic::before {
  background: radial-gradient(circle, #e4ff9e 0 1.4px, transparent 2px) 0 0 / 9px 9px,
              radial-gradient(circle, #b6ff5c 0 1px, transparent 1.5px) 4px 5px / 7px 7px,
              linear-gradient(#7dff3d, #3fae00);
  animation: frBoilUp 1.4s linear infinite;
}
@keyframes frBoilUp { to { background-position: 0 -18px, 4px -9px, 0 0; } }
.tile.it-fr_toxic:not([class*="fx-"])::after {
  bottom: auto; height: 34%; transform-origin: 50% 0;
  --gk: linear-gradient(#7dff3d, #5fd400); --gb: radial-gradient(closest-side, #b6ff7a 0 30%, #7dff3d 55% 92%, transparent 100%);
  background:
    var(--gk) 14% 0 / 7px 55% no-repeat, var(--gb) 14% 54% / 13px 13px no-repeat,
    var(--gk) 43% 0 / 8px 85% no-repeat, var(--gb) 43% 90% / 15px 15px no-repeat,
    var(--gk) 72% 0 / 6px 38% no-repeat, var(--gb) 72% 38% / 12px 12px no-repeat,
    var(--gk) 90% 0 / 7px 65% no-repeat, var(--gb) 90% 66% / 13px 13px no-repeat;
  filter: drop-shadow(0 0 4px rgba(125, 255, 61, .7));
  animation: frOoze 3s ease-in-out infinite alternate;
}
@keyframes frOoze { from { transform: scaleY(.45); } to { transform: scaleY(1); } }

/* ---------- Hologram: iridescent scan-lined rim with flickering sci-fi HUD corner brackets ---------- */
.tile.it-fr_hologram { border-color: rgba(39, 232, 255, .5); box-shadow: 0 0 16px rgba(39, 232, 255, .35); --fr-w: 4px; }
.tile.it-fr_hologram::before {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .55) 0 1px, transparent 1px 4px) 0 0 / 100% 8px,
              linear-gradient(90deg, #27e8ff, #b16bff, #ff2d95, #3dff9a, #27e8ff) 0 0 / 300% 100%;
  opacity: .85; animation: frHolo 3s linear infinite;
}
@keyframes frHolo { to { background-position: 0 -40px, 150% 0; } }
.tile.it-fr_hologram:not([class*="fx-"])::after {
  --hb: linear-gradient(#9ff8ff, #9ff8ff);
  background:
    var(--hb) left 8px top 8px / 18px 2px no-repeat, var(--hb) left 8px top 8px / 2px 18px no-repeat,
    var(--hb) right 8px top 8px / 18px 2px no-repeat, var(--hb) right 8px top 8px / 2px 18px no-repeat,
    var(--hb) left 8px bottom 8px / 18px 2px no-repeat, var(--hb) left 8px bottom 8px / 2px 18px no-repeat,
    var(--hb) right 8px bottom 8px / 18px 2px no-repeat, var(--hb) right 8px bottom 8px / 2px 18px no-repeat;
  filter: drop-shadow(0 0 3px #27e8ff); animation: frHud 2.2s steps(1) infinite;
}
@keyframes frHud { 0%, 100% { opacity: 1; } 40% { opacity: .35; } 43% { opacity: 1; } 46% { opacity: .5; } 49% { opacity: 1; } }
.art-frame.it-fr_hologram:not([class*="fx-"])::after { transform: scale(.6); }

/* ---------- Staff Aura: flowing red-gold rim and aura rings pulsing in from the edge (staff only) ---------- */
.tile.it-fr_staff { border-color: #ff3d3d; box-shadow: 0 0 24px rgba(255, 90, 60, .6); --fr-w: 5px; }
.tile.it-fr_staff::before {
  background: linear-gradient(90deg, #ff3d3d, #ffd34d, #ff7a2d, #ffd34d, #ff3d3d) 0 0 / 200% 100%;
  animation: frStaffFlow 2s linear infinite;
}
@keyframes frStaffFlow { to { background-position: 200% 0; } }
.tile.it-fr_staff:not([class*="fx-"])::after {
  border: 3px solid #ffd34d; box-shadow: 0 0 10px #ff7a2d, inset 0 0 10px #ff7a2d;
  animation: frAura 1.8s ease-out infinite;
}
@keyframes frAura { from { transform: scale(1); opacity: .9; } to { transform: scale(.82); opacity: 0; } }

/* ---------- reduced motion: every frame holds still ---------- */
@media (prefers-reduced-motion: reduce) {
  .tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff)::before, .tile:is(.it-fr_bronze, .it-fr_silver, .it-fr_gold, .it-fr_diamond, .it-fr_neon, .it-fr_doodle, .it-fr_bubble, .it-fr_tape, .it-fr_fire, .it-fr_ice, .it-fr_rainbow, .it-fr_disco, .it-fr_glitch, .it-fr_royal, .it-fr_toxic, .it-fr_hologram, .it-fr_staff)::after { animation: none !important; }
}
